chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lu, Wentao" <>
Subject RE: "Stream already closed" error when upload a big file through OpenCMIS bridge
Date Mon, 15 Sep 2014 21:20:39 GMT
Hi Florian,

I did not modify any code from the downloaded war file, just modify the ""
file pointing to our backend CMIS server and then use workbench to test.

>From temp folder, I can see a "MIME*.tmp" with the same size is created, it seems not
a permission issue.

After digging further, I guess I know what happened:  

by default set max_stream_length = 10MB 

private static final long MAX_STREAM_LENGTH = 10 * 1024 * 1024;

When create document with a bigger (more than 10MB) file via Atompub from workbench, it base64
encoded the content, but exceed the limit, so somehow it returned a weird error when client
using web service binding, but when client using atom binding from the bridge, I got below
errors which I think it is the real error:

org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Limit exceeded!
        at org.apache.chemistry.opencmis.server.shared.CappedInputStream.checkLength(

So I changed my code logic to "set document first, then set content stream later", by this
approach, I was able to upload very big files (200MB) via the bridge (using soap to atom forward)


-----Original Message-----
From: Florian Müller [] 
Sent: 2014, September 13 9:18 AM
Cc: Lu, Wentao
Subject: Re: "Stream already closed" error when upload a big file through OpenCMIS bridge

Hi Wentao,

There could be many reasons.
Are you processing the stream in the bridge somehow or do you just forward the request?
Big documents are buffered on disk. Is your temp directory writable for the bridge?

- Florian

> Hi,
> I am testing OpenCMIS bridge 0.10. Client side uses soap to call "createDocument" and
we setup OpenCMIS bridge to convert the soap request to atompub to our backend CMIS server
> It works fine with small document, but failed when I tried a 10MB file. It works if I
test directly to backend CMIS server.
> Below is the error get from SOAPUI:
>          <S:Detail>
>             <cmisFault:cmisFault xmlns:ns2=""
xmlns="" xmlns:cmisFault="">
>                <type>runtime</type>
>                <code>0</code>
>                <message>Cannot access http://mydev:7002/fncmis/resources/IMM_QA01/ContentFlat/idf_E5A8A3C4-B2F2-4100-9A96-B7429037B58E?versioningState=major:
Stream already closed</message>
>                <stacktrace:stacktrace xmlns=""
Cannot access http://mydev:7002/fncmis/resources/IMM_QA01/ContentFlat/idf_E5A8A3C4-B2F2-4100-9A96-B7429037B58E?versioningState=major:
Stream already closed
>               at org.apache.chemistry.opencmis.client.bindings.spi.http.DefaultHttpInvoker.invoke(
>                 at org.apache.chemistry.opencmis.client.bindings.spi.http.DefaultHttpInvoker.invokePOST(
>                 at
>                 at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createDocument(
>                 at org.apache.chemistry.opencmis.bridge.FilterCmisService.createDocument(
>                 at
>               at org.apache.chemistry.opencmis.server.impl.webservices.ObjectService.createDocument(
>                 at sun.reflect.GeneratedMethodAccessor420.invoke(Unknown Source)
>                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>                 at java.lang.reflect.Method.invoke(
>                 at$1.invoke(
>                 at$2.invoke(
>                 at
>                 at
>                 at
>                 at
>                 at
>                 at
>                 at$2.process(
>                 at$HttpToolkit.handle(
>                 at
>                 at
>                 at
>                 at
>                 at
>                 at javax.servlet.http.HttpServlet.service(
>                 at org.apache.chemistry.opencmis.server.impl.webservices.CmisWebServicesServlet.service(
>                 at javax.servlet.http.HttpServlet.service(
>                 at weblogic.servlet.internal.StubSecurityHelper$
>                 at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
>                 at weblogic.servlet.internal.ServletStubImpl.execute(
>                 at weblogic.servlet.internal.ServletStubImpl.execute(
>                 at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(
>                 at weblogic.servlet.internal.WebAppServletContext$
>                 at
>                 at
>                 at weblogic.servlet.internal.WebAppServletContext.securedExecute(
>                 at weblogic.servlet.internal.WebAppServletContext.execute(
>                 at
>                 at
>                 at 
> Caused by: java.lang.IllegalStateException: Stream already closed
>                 at java.lang.Throwable.&lt;init>(
>                 at org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(
>                 at org.jvnet.mimepull.DataHead$
>                 at
>                 at
>                 at org.apache.chemistry.opencmis.commons.impl.Base64$
>                 at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomEntryWriter.writeContent(
>                 at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomEntryWriter.write(
>                 at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl$1.write(
>               at org.apache.chemistry.opencmis.client.bindings.spi.http.DefaultHttpInvoker.invoke(
>                 ... 40 more</stacktrace:stacktrace>
>             </cmisFault:cmisFault>
>          </S:Detail>
> I am not sure if this related with mimepull version, I tried to replace mimepull 1.3
jar to mimepull 1.9.4, but still get the same error.
> Any ideas?
> Thanks
> Wentao
> ________________________________
> This email and its attachments are intended solely for the personal use of the individual
or entity named above. Any use of this communication by an unintended recipient is strictly
prohibited. If you have received this email in error, any publication, use, reproduction,
disclosure or dissemination of its contents is strictly prohibited. Please immediately delete
this message and its attachments from your computer and servers. We would also appreciate
if you would contact us by a collect call or return email to notify us of this error. Thank
you for your cooperation.
> -BCHydroDisclaimerID5.2.8.1541

View raw message