chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jevon" <je...@jevon.org>
Subject Invalid chunk header when replacing Document contents
Date Tue, 16 Apr 2013 06:07:52 GMT
Hi,

We're having problems with a deployment of OpenCMIS 0.8 interacting with
Alfresco. When using setContentStream() on an existing Document, Alfresco
is reporting an "Invalid chunk header" and the document contents do not
change.

This error doesn't occur when uploading a new document, or on replacing
documents less than 10 KB. Unfortunately I haven't been able to reproduce
it locally but I can reproduce it on a different deployment environment.
Tomcat 7's default Http11 connector does not support disabling chunking. As
far as I can tell, it isn't an issue with permissions, SSL, folder paths,
firewalls, proxies or file content.

As a workaround we're considering having to delete the existing document
before uploading a new one, but this will lose the previous history
associated with the document.

Short of inspecting the data flow with Wireshark/etc, how could we look at
fixing this issue? Could this be an Alfresco, Chemistry, Tomcat or other
issue? Is there any way to convince OpenCMIS to not use a chunked
connection when uploading content?

Thanks for any help.

Jevon

[1] Stacktrace on CMIS client:

org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
Internal Server Error
        at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:452)
        at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.put(AbstractAtomPubService.java:595)
        at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.setContentStream(ObjectServiceImpl.java:624)
        at org.apache.chemistry.opencmis.client.runtime.DocumentImpl.setContentStream(DocumentImpl.java:412)
        at org.apache.chemistry.opencmis.client.runtime.DocumentImpl.setContentStream(DocumentImpl.java:392)
        at ...


Stacktrace on Alfresco server:

java.lang.RuntimeException: java.io.IOException: Invalid chunk header
        at org.alfresco.repo.web.scripts.RepositoryContainer$BufferedRequest$1.getInputStream(RepositoryContainer.java:1059)
        at org.alfresco.repo.web.scripts.content.ContentSet.execute(ContentSet.java:175)
        at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:417)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:479)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:517)
        at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:333)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
        at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.IOException: Invalid chunk header
        at org.apache.coyote.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFilter.java:133)
        at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:710)
        at org.apache.coyote.Request.doRead(Request.java:427)
        at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
        at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:421)
        at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
        at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:162)
        at org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:112)
        at org.alfresco.repo.web.scripts.RepositoryContainer$BufferedRequest.getRequestBodyAsFile(RepositoryContainer.java:938)
        at org.alfresco.repo.web.scripts.RepositoryContainer$BufferedRequest.access$600(RepositoryContainer.java:918)
        at org.alfresco.repo.web.scripts.RepositoryContainer$BufferedRequest$1.getInputStream(RepositoryContainer.java:1055)
        ... 29 more


Code that executes setContentStream():

    public void replaceContents(InputStream stream, long length,
            String contentType) {

        Document doc = (Document) getCmisObject();
        ContentStream contentStream = new ContentStreamImpl(getName(),
BigInteger.valueOf(length), contentType, stream);
        doc.setContentStream(contentStream, true);

    }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message