chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lu, Wentao" <Wentao...@bchydro.com>
Subject RE: "Stream already closed" error when upload a big file through OpenCMIS bridge
Date Tue, 16 Sep 2014 17:49:11 GMT
Hi Florian,

"woodstox-core-asl-4.2.0.jar" is under the war file WEB-INF/lib folder, when I checked with
WebLogic class loader, I found WebLogic instead load its own jar file "com.bea.core.woodstox_1.0.0.0_4-0-5.jar"
which is version 4.0.5, do we have to use 4.2.0.jar?


Thanks
Wentao

-----Original Message-----
From: Florian Müller [mailto:fmui@apache.org] 
Sent: 2014, September 16 12:22 AM
To: Lu, Wentao; dev@chemistry.apache.org
Subject: RE: "Stream already closed" error when upload a big file through OpenCMIS bridge

Hi Wentao,

A "Limit exceeded!" error is an indicator for an unsupported XML parser. Please make sure
you have Woodstox 4 on your class path (or switch to OpenCMIS 0.12.0, which forces the use
of Woodstox 4).
With a correct setup you can send an arbitrary big document via the AtomPub binding. It has
been tested with documents that were several GB big.


- Florian


> 
> Hi Florian,
> 
> I did not modify any code from the downloaded war file, just modify 
> the "repository.properties" 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 AtomEntryParser.java 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(CappedInputStream.java:71)
>         at
> org.apache.chemistry.opencmis.server.shared.CappedInputStream.read(CappedInputStream.java:107)
>         at java.io.FilterInputStream.read(FilterInputStream.java:116)
> 
> 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)
> 
> Thanks
> Wentao
> 
> 
> 
> -----Original Message-----
> From: Florian Müller [mailto:fmui@apache.org]
> Sent: 2014, September 13 9:18 AM
> To: dev@chemistry.apache.org
> 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 (IBM CMIS).
> > 
> > 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="http://docs.oasis-open.org/ns/cmis/core/200908/"
> > xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/"
> > xmlns:cmisFault="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
> >                <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="http://chemistry.apache.org/opencmis/exception"
> > xmlns:stacktrace="http://chemistry.apache.org/opencmis/exception">org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException:
> > 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(DefaultHttpInvoker.java:224)
> >                 at
> > org.apache.chemistry.opencmis.client.bindings.spi.http.DefaultHttpInvoker.invokePOST(DefaultHttpInvoker.java:63)
> >                 at
> > org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:625)
> >                 at
> > org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createDocument(ObjectServiceImpl.java:119)
> >                 at
> > org.apache.chemistry.opencmis.bridge.FilterCmisService.createDocument(FilterCmisService.java:201)
> >                 at
> > org.apache.chemistry.opencmis.server.support.CmisServiceWrapper.createDocument(CmisServiceWrapper.java:719)
> >               at
> > org.apache.chemistry.opencmis.server.impl.webservices.ObjectService.createDocument(ObjectService.java:84)
> >                 at 
> > sun.reflect.GeneratedMethodAccessor420.invoke(Unknown
> > Source)
> >                 at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> >                 at java.lang.reflect.Method.invoke(Method.java:600)
> >                 at
> > com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
> >                 at
> > com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:151)
> >                 at
> > com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl.invoke(EndpointMethodHandlerImpl.java:268)
> >                 at
> > com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:100)
> >                 at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:866)
> >                 at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:815)
> >                 at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:778)
> >                 at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:680)
> >                 at
> > com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:403)
> >                 at
> > com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:532)
> >                 at
> > com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:253)
> >                 at
> > com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:140)
> >                 at
> > com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
> >                 at
> > com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
> >                 at
> > com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
> >                 at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> >                 at
> > org.apache.chemistry.opencmis.server.impl.webservices.CmisWebServicesServlet.service(CmisWebServicesServlet.java:167)
> >                 at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> >                 at
> > weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
> >                 at
> > weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
> >                 at
> > weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
> >                 at
> > weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
> >                 at
> > weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
> >                 at
> > weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
> >                 at
> > weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
> >                 at
> > weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
> >                 at
> > weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
> >                 at
> > weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
> >                 at
> > weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
> >                 at
> > weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
> >                 at
> > weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
> > Caused by: java.lang.IllegalStateException: Stream already closed
> >                 at java.lang.Throwable.<init>(Throwable.java:67)
> >                 at
> > org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(DataHead.java:231)
> >                 at
> > org.jvnet.mimepull.DataHead$ReadMultiStream.read(DataHead.java:207)
> >                 at
> > java.io.BufferedInputStream.fill(BufferedInputStream.java:230)
> >                 at
> > java.io.BufferedInputStream.read(BufferedInputStream.java:249)
> >                 at
> > org.apache.chemistry.opencmis.commons.impl.Base64$InputStream.read(Base64.java:1671)
> >                 at
> > org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomEntryWriter.writeContent(AtomEntryWriter.java:241)
> >                 at
> > org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomEntryWriter.write(AtomEntryWriter.java:181)
> >                 at
> > org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl$1.write(ObjectServiceImpl.java:121)
> >               at
> > org.apache.chemistry.opencmis.client.bindings.spi.http.DefaultHttpInvoker.invoke(DefaultHttpInvoker.java:192)
> >                 ... 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
> > 
>
Mime
View raw message