AnsweredAssumed Answered

05130076 Wrapped Exception (with status template): com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog

Question asked by johan.lelan on Jun 13, 2013
Hello,

I try to set value for a aspect's property. But a "com.ctc.wstx.exc.WstxEOFException" occured.
I am using cmis to create the new document and aflrescoDocument to set custom properties.

I don't understand my mistake?

This is my customModel.xml:

<aspects>
   <aspect name="foo:metadata">
      <title>foo title</title>
      <properties>
         <property name="foo:domain">
            <title>Domain</title>
            <type>d:text</type>
            <protected>false</protected>
            <mandatory>false</mandatory>
            <multiple>false</multiple>
         </property>
         <property name="foo:identifier">
            <title>Identifier</title>
            <type>d:text</type>
            <protected>false</protected>
            <mandatory>false</mandatory>
            <multiple>true</multiple>
            </property>
      </properties>
   </aspect>
</aspects>


My processor to update metadata:


Map<String, Object> updateProperties = new HashMap<String, Object>();
updateProperties.put("foo:domain", "bar");
updateProperties.put("foo:identifier", "barId");
AlfrescoDocument alfDoc = (AlfrescoDocument) cmisObject;
addCustomProperties(alfDoc, updateProperties);

//…

private void addCustomProperties(AlfrescoDocument alfDoc, Map<String, Object> updateProperties)
{
   try
   {
      // specified all custom aspect type
      List<String> aspects= new ArrayList<String>();
      aspects.add("P:foo:metadata");
      
      for (String aspect : aspects)
      {
         if (!alfDoc.hasAspect(aspect))
         {
            alfDoc.addAspect(aspect); // Exception here
         }
         alfDoc.updateProperties(updateProperties, true);
      }
   }
   catch(Exception e)
   {
      log.warn("When adding custom properties", e);
   }
}


And the exception :
<php>
<!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/webscripts.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%2Fservice%2Fcmis%2Fs%2Fworkspace%3ASpacesStore%2Fi%2Fbbe587c1-8458-4d6c-8cf4-61053a65a5e9">/alfresco/service/cmis/s/workspace:SpacesStore/i/bbe587c1-8458-4d6c-8cf4-61053a65a5e9</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>05130076 Wrapped Exception (with status template): com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]</td></tr>
            <tr><td></td><td> </td></tr>
   <tr><td><b>Exception:</b></td><td>com.ctc.wstx.exc.WstxEOFException - Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]</td></tr>
   <tr><td></td><td> </td></tr>
         <tr><td></td><td>com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)</td></tr>
         <tr><td></td><td>com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)</td></tr>
         <tr><td></td><td>com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)</td></tr>
         <tr><td></td><td>com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)</td></tr>
         <tr><td></td><td>org.apache.abdera.parser.stax.FOMBuilder.getNextElementToParse(FOMBuilder.java:163)</td></tr>
         <tr><td></td><td>org.apache.abdera.parser.stax.FOMBuilder.next(FOMBuilder.java:187)</td></tr>
         <tr><td></td><td>org.apache.abdera.parser.stax.FOMBuilder.getFomDocument(FOMBuilder.java:333)</td></tr>
         <tr><td></td><td>org.apache.abdera.parser.stax.FOMParser.getDocument(FOMParser.java:72)</td></tr>
         <tr><td></td><td>org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:207)</td></tr>
         <tr><td></td><td>org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:145)</td></tr>
         <tr><td></td><td>org.apache.abdera.util.AbstractParser.parse(AbstractParser.java:101)</td></tr>
         <tr><td></td><td>org.springframework.extensions.webscripts.atom.AbderaServiceImpl.parse(AbderaServiceImpl.java:152)</td></tr>
         <tr><td></td><td>org.springframework.extensions.webscripts.atom.AtomReader.read(AtomReader.java:85)</td></tr>
         <tr><td></td><td>org.springframework.extensions.webscripts.atom.AtomReader.createScriptParameters(AtomReader.java:99)</td></tr>
         <tr><td></td><td>org.springframework.extensions.webscripts.AbstractWebScript.createScriptParameters(AbstractWebScript.java:407)</td></tr>
         <tr><td></td><td>org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:81)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:383)</td></tr>
         <tr><td></td><td>org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)</td></tr>
         <tr><td></td><td>org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)</td></tr>
         <tr><td></td><td>org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)</td></tr>
         <tr><td></td><td>org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)</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.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)</td></tr>
         <tr><td></td><td>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)</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:127)</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:298)</td></tr>
         <tr><td></td><td>org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)</td></tr>
         <tr><td></td><td>org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)</td></tr>
         <tr><td></td><td>org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)</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.apache.abdera.parser.ParseException - com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]</td></tr>
   <tr><td></td><td> </td></tr>
      <tr><td></td><td>org.apache.abdera.parser.stax.FOMBuilder.next(FOMBuilder.java:260)</td></tr>
   <tr><td></td><td> </td></tr>
   <tr><td><b>Exception:</b></td><td>org.springframework.extensions.webscripts.WebScriptException - 05130076 Wrapped Exception (with status template): com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]</td></tr>
   <tr><td></td><td> </td></tr>
      <tr><td></td><td>org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:758)</td></tr>
   <tr><td></td><td> </td></tr>
            <tr><td><b>Server</b>:</td><td>Community v3.4.0 (d 3370) schema 4 113</td></tr>
            <tr><td><b>Time</b>:</td><td>13 juin 2013 15:22:29</td></tr>
            <tr><td></td><td> </td></tr>
            <tr><td><b>Diagnostics</b>:</td><td><a href="/alfresco/service/script/org/alfresco/cmis/item.put">Inspect Web Script (org/alfresco/cmis/item.put)</a></td></tr>
         </table>
      </div>
   </body>
</html>
</php>

Outcomes