Hi All,

I am using Camel 2.5. I need to disable chunking and for that i have
configured the following:

<http-conf:conduit name="*.http-conduit">
                <http-conf:client AllowChunking="false"/>
</http-conf:conduit>

What is happening is that Transfer-Encoding is common between server and
client. The first request to the webservice goes fine, but i guess in the
response the Transfer -encoding is set by the tomcat server. The same header
is propagated to the call to a second webservice.

Setting AllowChunking="false" does not remove that header, however the
payload is not chunked. So when the tomcat server receives the second
request it sees the header and tries to read the length from the header but
does not find it as the request is not chunked. So it throws the following
exception:

SEVERE: Couldn't create SOAP message due to exception: Unable to create StAX
reader or writer
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP
message due to exception: Unable to create StAX reader or writer
        at
com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:365)
        at
com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:277)
        at
com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
        at
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:457)
        at 
com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
        at
com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
        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:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:203)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
        at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:281)
        at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:357)
        at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1671)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: com.sun.xml.ws.streaming.XMLReaderException: Unable to create
StAX reader or writer
        at
com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$NoLock.doCreate(XMLStreamReaderFactory.java:412)
        at
com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Woodstox.doCreate(XMLStreamReaderFactory.java:436)
        at
com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.doCreate(XMLStreamReaderFactory.java:201)
        at
com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:154)
        at 
com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:301)
        at 
com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:129)
        at
com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:360)
        ... 25 more
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid chunk header
        at 
com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:548)
        at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:604)
        at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:660)
        at
com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:355)
        at
com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$NoLock.doCreate(XMLStreamReaderFactory.java:410)
        ... 31 more
Caused by: java.io.IOException: Invalid chunk header
        at
org.apache.coyote.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFilter.java:143)
        at
org.apache.coyote.http11.InternalAprInputBuffer.doRead(InternalAprInputBuffer.java:526)
        at org.apache.coyote.Request.doRead(Request.java:426)
        at
org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:286)
        at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:407)
        at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:309)
        at
org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:198)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at
com.ctc.wstx.io.ReaderBootstrapper.initialLoad(ReaderBootstrapper.java:245)
        at
com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:132)
        at 
com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:543)
        ... 35 more

To add the issue  https://issues.apache.org/activemq/browse/CAMEL-2452
CAMEL-2452  has not been fixed in 2.5 version.

Any help to turn off transfer encoding would be helpful.

Best Regards,
Madhav
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-http-conduit-AllowChunking-does-not-work-tp3247495p3247495.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to