java - Camel CXF: compressing response with CXFOutInterceptor throws classcast exception -


i have service bundle want compress response using cxf gzipfeature. bundle deployed on jboss fuse(jboss-fuse-6.1.0.redhat-379). camel route configuraion is:

<cxf:bus id="cxf" name ="cxf">     <cxf:features>         <bean class="org.apache.cxf.transport.common.gzip.gzipfeature">             <property name="threshold">                 <value>1</value>             </property>         </bean>     </cxf:features> </cxf:bus>  <camel:camelcontext ...>     <camel:route id="test-server">         <camel:to uri="cxfbean:servicebeans?bus=#cxf&amp;providers=#providers" />     </camel:route> </camel:camelcontext> 

but throws classcast exception:

java.lang.classcastexception: org.apache.cxf.transport.common.gzip.gzipoutinterceptor$gzipthresholdoutputstream cannot cast org.apache.cxf.io.cachedoutputstream @ org.apache.camel.component.cxf.transport.cameldestination$cameloutputstream.commitoutputmessage(cameldestination.java:284)[204:org.apache.camel.camel-cxf-transport:2.12.0.redhat-610379] @ org.apache.camel.component.cxf.transport.cameldestination$cameloutputstream.doclose(cameldestination.java:296)[204:org.apache.camel.camel-cxf-transport:2.12.0.redhat-610379] @ org.apache.cxf.io.cachedoutputstream.close(cachedoutputstream.java:220)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379] @ java.util.zip.deflateroutputstream.close(deflateroutputstream.java:241)[:1.7.0_67] @ org.apache.cxf.io.abstractwrappedoutputstream.close(abstractwrappedoutputstream.java:77)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379] @ org.apache.cxf.io.abstractthresholdoutputstream.close(abstractthresholdoutputstream.java:102)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379] @ org.apache.cxf.transport.abstractconduit.close(abstractconduit.java:56)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379] @ org.apache.cxf.interceptor.messagesenderinterceptor$messagesenderendinginterceptor.handlemessage(messagesenderinterceptor.java:62)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379] @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:272)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379] 

is there legal way use cxf gzipfeature in route? don't want use camel's dataformat gzip.

i'm using servicemix-camel-cxf , had same problem. in end decided add in route:

<marshal> <gzip/> </marshal>

check out - maybe too. in case have set content-type: gzip header.

try add

<setheader headername="content-type">     <constant>gzip</constant></setheader> 

however me didn't help, added header in java code. =)


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -