AnsweredAssumed Answered

CMIS File upload Fehler

Question asked by martin.lumpp on Feb 2, 2010
Latest reply on Jul 19, 2010 by sued_faust
Hallo,

ich arbeite mich gerade in die CMIS Schnittstelle von Alfresco ein und bearbeite hierfür das Beispiel von  jeffpotts und Alfresco 3.2.

Seinem Beispiel nach kann ich mittels curl und xml ein neues Verzeichnis anlegen. Allerdings funktioniert sein Beispiel nicht mit dem Hochladen einer Datei. Es gibt einen Internen Fehler 'Cannot read property "native Value" from null. ' Google und Doku geben leider keinen Hinweis.

Kann hier evtl. jemand helfen?

Snippets anbei:
Upload xml-payload:

<?xml version="1.0" encoding="utf-8"?>
            <entry xmlns="http://www.w3.org/2005/Atom"
                xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
                xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908">

                <title>Feder.bmp</title>
                <summary>testbild - windows feder.</summary>
                <content type="image/bmp">{base64 encoded content}</content>
                <cmisra:object>
                     <cmis:properties>
                       <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
                            <cmis:value>D:cmiscustom:document</cmis:value>
                        </cmis:propertyId>
                    </cmis:properties>
               </cmisra:object>
            </entry>

result:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <title>Web Script Status 500 - Internal Error</title>
      <link rel="stylesheet" href="/alfresco/css/base.css" type="text/css" />
   </head>
   <body>
      <div>
         <table>
            <tr>
               <td><img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" /></td>
               <td><span class="title">Web Script Status 500 - Internal Error</span></td>
            </tr>
         </table>
         <br/>
         <table>
            <tr><td>The Web Script <a href="%2Falfresco%2Fs%2Fcmis%2Fp%2Fphpupload%2Fchildren">/alfresco/s/cmis/p/phpupload/children</a> has responded with a status of 500 - Internal Error.</td></tr>
         </table>
         <br/>
         <table>
            <tr><td><b>500 Description:</b></td><td> An error inside the HTTP server which prevented it from fulfilling the request.</td></tr>
            <tr><td> </td></tr>
            <tr><td><b>Message:</b></td><td>01020054 Wrapped Exception (with status template): 01020053 Failed to execute script '/org/alfresco/cmis/children.post.atom.js (in classpath store file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 01020052 TypeError: Cannot read property &quot;nativeValue&quot; from null (file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js#93)</td></tr>
            <tr><td></td><td> </td></tr>
   <tr><td><b>Exception:</b></td><td>org.mozilla.javascript.EcmaError - TypeError: Cannot read property &quot;nativeValue&quot; from null (file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js#93)</td></tr>
   <tr><td></td><td> </td></tr>
         <tr><td></td><td>org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3356)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3375)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3388)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1362)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.gen.c10._c4(file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js:93)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.gen.c10.call(file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.gen.c10._c0(file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js:464)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.gen.c10.call(file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.gen.c10.call(file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js)</td></tr>
         <tr><td></td><td>org.mozilla.javascript.gen.c10.exec(file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js)</td></tr>
         <tr><td></td><td>org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:457)</td></tr>
         <tr><td></td><td>org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:174)</td></tr>
         <tr><td></td><td>org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:274)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:108)</td></tr>
         <tr><td></td><td>org.alfresco.web.scripts.AbstractWebScript.executeScript(AbstractWebScript.java:819)</td></tr>
         <tr><td></td><td>org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:90)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:372)</td></tr>
         <tr><td></td><td>org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:327)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:422)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:439)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:303)</td></tr>
         <tr><td></td><td>org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:306)</td></tr>
         <tr><td></td><td>org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:183)</td></tr>
         <tr><td></td><td>org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)</td></tr>
         <tr><td></td><td>javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</td></tr>
         <tr><td></td><td>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)</td></tr>
         <tr><td></td><td>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</td></tr>
         <tr><td></td><td>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)</td></tr>
         <tr><td></td><td>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)</td></tr>
         <tr><td></td><td>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)</td></tr>
         <tr><td></td><td>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)</td></tr>
         <tr><td></td><td>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)</td></tr>
         <tr><td></td><td>org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)</td></tr>
         <tr><td></td><td>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)</td></tr>
         <tr><td></td><td>org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)</td></tr>
         <tr><td></td><td>org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)</td></tr>
         <tr><td></td><td>java.lang.Thread.run(Thread.java:619)</td></tr>
   <tr><td></td><td> </td></tr>
   <tr><td><b>Exception:</b></td><td>org.alfresco.error.AlfrescoRuntimeException - 01020052 TypeError: Cannot read property &quot;nativeValue&quot; from null (file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js#93)</td></tr>
   <tr><td></td><td> </td></tr>
      <tr><td></td><td>org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:473)</td></tr>
   <tr><td></td><td> </td></tr>
   <tr><td><b>Exception:</b></td><td>org.alfresco.scripts.ScriptException - 01020053 Failed to execute script '/org/alfresco/cmis/children.post.atom.js (in classpath store file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 01020052 TypeError: Cannot read property &quot;nativeValue&quot; from null (file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js#93)</td></tr>
   <tr><td></td><td> </td></tr>
      <tr><td></td><td>org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:178)</td></tr>
   <tr><td></td><td> </td></tr>
   <tr><td><b>Exception:</b></td><td>org.alfresco.web.scripts.WebScriptException - 01020054 Wrapped Exception (with status template): 01020053 Failed to execute script '/org/alfresco/cmis/children.post.atom.js (in classpath store file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 01020052 TypeError: Cannot read property &quot;nativeValue&quot; from null (file:/var/lib/tomcat6/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/cmis/children.post.atom.js#93)</td></tr>
   <tr><td></td><td> </td></tr>
      <tr><td></td><td>org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)</td></tr>
   <tr><td></td><td> </td></tr>
            <tr><td><b>Server</b>:</td><td>Alfresco Community v3.2.0 (r2 2440) schema 3.300</td></tr>
            <tr><td><b>Time</b>:</td><td>02.02.2010 15:40:53</td></tr>
            <tr><td></td><td> </td></tr>
            <tr><td><b>Diagnostics</b>:</td><td><a href="/alfresco/s/script/org/alfresco/cmis/children.post">Inspect Web Script (org/alfresco/cmis/children.post)</a></td></tr>
         </table>
      </div>
   </body>
</html>

Outcomes