Hi,
I am using Mule as a proxy with the following configuration:
<model name="proxies">
<service name="productCatalog">
<inbound>
</inbound>
<outbound>
<pass-through-router>
</pass-through-router>
</outbound>
</service>
</model>
When I do a request that generates a response larger than 4028 characters Mule (2.1.2) throws the following exception:
2009-jan-07 16:38:20 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: COULD_NOT_READ_XML_STREAM
at org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter.write(StaxDataBinding.java:131)
at org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter.write(StaxDataBinding.java:117)
at org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter.write(StaxDataBinding.java:113)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:113)
at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:198)
at org.mule.transport.cxf.CxfServiceComponent$1.write(CxfServiceComponent.java:270)
at org.mule.transport.http.HttpServerConnection.writeResponse(HttpServerConnection.java:294)
at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Unknown Source)
Caused by: com.ctc.wstx.exc.WstxIOException: Attempted read on closed stream.
at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:708)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
at org.apache.cxf.staxutils.DepthXMLStreamReader.next(DepthXMLStreamReader.java:220)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:352)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:314)
at org.mule.transport.cxf.support.OutputPayloadInterceptor$1.write(OutputPayloadInterceptor.java:66)
at org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter.write(StaxDataBinding.java:125)
... 13 more
Caused by: java.io.IOException: Attempted read on closed stream.
at org.apache.commons.httpclient.AutoCloseInputStream.isReadAllowed(AutoCloseInputStream.java:183)
at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:126)
at org.mule.model.streaming.DelegatingInputStream.read(DelegatingInputStream.java:58)
at com.ctc.wstx.io.UTF8Reader.loadMore(UTF8Reader.java:365)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:110)
at com.ctc.wstx.io.MergedReader.read(MergedReader.java:101)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1046)
at com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1053)
at com.ctc.wstx.sr.StreamScanner.getNextCharFromCurrent(StreamScanner.java:811)
at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3209)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2830)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
... 18 more
According to SoapUI the only that comes back from the server is:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Wed, 07 Jan 2009 04:54:02 CET
Expires: Wed, 07 Jan 2009 04:54:02 CET
Connection: close
Content-Type: text/xml
Server: Mule Core/2.1.2
I have created an web service using CXF that I can use to reproduce the error. The source to it is attached. The mule config file is also include in the file.
The web service contains only one method - getProducts(int nrOfProducts, int descriptionLength).
Using the both parameters I can decide the size of the reponse.
When I request 1 product with the descriptionLength = 3742 I get a response.
If I increase the descriptionLength with one, that is, to 3743 I always get the above error. SoapUI reports 4028 bytes when successful, 0 bytes when the exception is thrown.
Could this be some form of buffer problem?
If I enable debug logging I can see that the class httpclient.wire.content logs the entire response from the service, so the service is working.
This is a critical bug for us, so any help is appreciated.
Thanks in advance,
Lennart
Info about my config:
**********************************************************************
* Mule ESB and Integration Platform *
* Version: 2.1.2 Build: 13558 *
* MuleSource, Inc. *
* *
* Server started: 2009-01-07 16:37 *
* Server ID: 161c9416-dcd1-11dd-b480-553a4317a710 *
* JDK: 1.6.0_07 (mixed mode) *
* Encoding: OS: Cp1252, Mule: UTF-8 *
* OS: Windows Vista - Service Pack 1 (6.0, x86) *
* Host: stopc6442 (192.168.3.54) *
* *
* Agents Running: None *
**********************************************************************