cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vitaly Litvak <vitava...@gmail.com>
Subject Re: Problem with GZIP and mtom attachments
Date Thu, 17 Sep 2009 09:40:25 GMT

Thanks for your answer. I've submitted a bug 
https://issues.apache.org/jira/browse/CXF-2440 here  with my small test case
attached.

After some testing I noticed that it reproduces only on client side. On the
server side everything works fine (the file is downloaded, unpacked and read
correctly).


dkulp wrote:
> 
> 
> It SOUNDS like a bug, probably an interceptor ordering issue.   Is there
> any 
> way you could create a small test case and log a bug?
> 
> Dan
> 
> 
> On Wed September 16 2009 9:59:12 am Виталий Литвак wrote:
>> Hi.
>> 
>> We were using CXF 2.0.10 in our application and now decided to use GZIP
>> compression for messages. So we've upgraded to CXF 2.2.3. After solving
>>  some migration problems we are finally available to use all our stuff
>>  without GZIP compression. But if we turn it on (by adding GZIPFeature to
>> ServerFactoryBean and ClientFactoryBean) then attachments are not being
>>  read throwing following exception:
>> 
>> On client:
>> 
>> java.io.IOException: stream is closed
>>     at
>> sun.net.www.http.ChunkedInputStream.ensureOpen(ChunkedInputStream.java:151)
>>     at
>>  sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:646) at
>>  java.io.FilterInputStream.read(FilterInputStream.java:116)
>>     at
>> sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLCon
>> nection.java:2446) at
>>  java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:221) at
>>  java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141) at
>>  java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92) at
>>  java.util.zip.InflaterInputStream.read(InflaterInputStream.java:105) at
>>  java.io.FilterInputStream.read(FilterInputStream.java:66)
>>     at java.io.PushbackInputStream.read(PushbackInputStream.java:122)
>>     at
>> org.apache.cxf.attachment.MimeBodyPartInputStream.read(MimeBodyPartInputStr
>> eam.java:192) at
>> org.apache.cxf.attachment.DelegatingInputStream.read(DelegatingInputStream.
>> java:57) at
>> com.fundcount.fcoffice.gui.CGlobalData.backupDatabase(CGlobalData.java:2427
>> )
>> 
>> On server:
>> 
>> 2009-09-16 17:30:41,187 ERROR: Sep 16, 2009 5:30:41 PM
>> org.apache.cxf.phase.PhaseInterceptorChain doIntercept
>> WARNING: Interceptor has thrown exception, unwinding now
>> org.apache.cxf.interceptor.Fault: Could not write attachments.
>>     at
>> org.apache.cxf.interceptor.AttachmentOutInterceptor$AttachmentOutEndingInte
>> rceptor.handleMessage(AttachmentOutInterceptor.java:82) at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>> n.java:236) at
>> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingC
>> hainInterceptor.java:74) at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
>> n.java:236) at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationO
>> bserver.java:104) at
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(Jet
>> tyHTTPDestination.java:302) at
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTT
>> PDestination.java:266) at
>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandle
>> r.java:70) at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>     at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCol
>> lection.java:230) at
>>  org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49) at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>     at org.mortbay.jetty.Server.handle(Server.java:324)
>>     at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>     at
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java
>> :879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741) at
>>  org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213) at
>>  org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403) at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409
>> ) at
>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:52
>> 2) Caused by: org.mortbay.jetty.EofException
>>     at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:787)
>>     at
>> org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:566
>> ) at
>> org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:946)
>>     at
>> org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:646
>> ) at
>> org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:577
>> ) at
>> org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputSt
>> ream.java:46) at
>> java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:161)
>>     at
>> java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:118)
>>     at java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:72)
>>     at
>> org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputSt
>> ream.java:46) at
>> org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutp
>> utStream.java:69) at
>>  javax.activation.DataHandler.writeTo(DataHandler.java:294)
>>     at
>> org.apache.cxf.attachment.AttachmentSerializer.writeAttachments(AttachmentS
>> erializer.java:153) at
>> org.apache.cxf.interceptor.AttachmentOutInterceptor$AttachmentOutEndingInte
>> rceptor.handleMessage(AttachmentOutInterceptor.java:80) ... 19 more
>> Caused by: java.io.IOException: Broken pipe
>>     at sun.nio.ch.FileDispatcher.write0(Native Method)
>>     at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
>>     at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
>>     at sun.nio.ch.IOUtil.write(IOUtil.java:60)
>>     at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
>>     at org.mortbay.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:169)
>>     at
>> org.mortbay.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:2
>> 21) at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:721) ...
>> 32
>>  more
>> 
>> We use simple frontend for our web services. Attachments are supposed to
>> be
>> loaded as a response from web-method, which is java-first designed method
>> returning DataHandler object with AttachmentDataSource in it.
>> 
>> Need some ideas. Are we doing something wrong or it is a bug in CXF and
>>  MTOM attachments simply does not work with gzip compression?
>> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-GZIP-and-mtom-attachments-tp25472988p25488134.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message