Because of the way CXF streams directly to the server, if the SERVER has a problem with the incoming stream, it may reject it immediately and the outgoing stream may close and you end up getting this type of error. I would actually check the server side to see if any stack traces are in it's logs.
What I would also suggest doing is configing the http conduit on the client to turn on the AutoRedirect. That has a sideaffect of requiring the entire message to be stored in a buffer before being sent. It's then sent out all in one shot. Since the HTTP conduit is then in complete control of the IO, it can better catch the exception and possibly grab the error stream from the URL connection to see if there is a fault there. Also, if you could try a wireshark or tcpdump trace, that may be useful as well. Dan On Monday 04 February 2008, Tor Arne Kvaløy wrote: > Hello! > > I have ran into a serious problem with CXF on the client side. I have > tried quite a few things but I am right now quite stuck, and I hope > that you guys have any suggestions. The full stacktrace is in this > mail. > > I get the same error both with 2.0.3 and 2.0.4. Can it be an issue > with JAXB, I am using jaxb-impl 2.0.5 from the sun-site. > > The following error is given when I invoke the web service method. > SubmitDataService service = new SubmitDataService(); > ISubmitData port = service.getSubmitDataPort(); > boolean ret = port.submitData(setId, setName, > fileName, getData(fileName), list); > > > INFO: Interceptor has thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Marshalling Error: Error writing > request body to server > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.jav >a:207) at > org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63) at > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writePart >s(AbstractOutDatabindingInterceptor.java:84) at > org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInt >erceptor.java:68) at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto >rChain.java:208) at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276) at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222) at > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135 >) at $Proxy26.submitData(Unknown Source) > at > com.pointcarbon.mule.SubmitDataClient.main(SubmitDataClient.java:85) > Caused by: javax.xml.bind.MarshalException > - with linked exception: > [java.io.IOException: Error writing request body to server] > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:2 >97) at > com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java >:221) at > javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshall >erImpl.java:70) at > org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder. >java:360) at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.jav >a:187) ... 10 more > Caused by: java.io.IOException: Error writing request body to server > at > sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.chec >kError(HttpURLConnection.java:2261) at > sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.writ >e(HttpURLConnection.java:2244) at > org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOut >putStream.java:45) at > org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputS >tream.java:64) at > com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.flushBuffer(UTF8XmlOu >tput.java:351) at > com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.ja >va:304) at > com.sun.xml.bind.v2.runtime.unmarshaller.Base64Data.writeTo(Base64Data >.java:263) at > com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.ja >va:251) at > com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.ja >va:312) at > com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$PcdataImpl.w >riteLeafElement(RuntimeBuiltinLeafInfoImpl.java:140) at > com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransd >ucedAccessorImpl.writeLeafElement(TransducedAccessor.java:214) at > com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.seriali >zeBody(SingleElementLeafProperty.java:62) at > com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanI >nfoImpl.java:286) at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer >.java:619) at > com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.seriali >zeBody(SingleElementNodeProperty.java:113) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Elemen >tBeanInfoImpl.java:98) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Elemen >tBeanInfoImpl.java:127) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementB >eanInfoImpl.java:244) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementB >eanInfoImpl.java:251) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementB >eanInfoImpl.java:33) at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.ja >va:461) at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:2 >92) ... 14 more > Exception in thread "Main Thread" > javax.xml.ws.soap.SOAPFaultException: Marshalling Error: Error writing > request body to server > at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175 >) at $Proxy26.submitData(Unknown Source) > at > com.pointcarbon.mule.SubmitDataClient.main(SubmitDataClient.java:85) > Caused by: org.apache.cxf.interceptor.Fault: Marshalling Error: Error > writing request body to server > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.jav >a:207) at > org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63) at > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writePart >s(AbstractOutDatabindingInterceptor.java:84) at > org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInt >erceptor.java:68) at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto >rChain.java:208) at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276) at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222) at > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135 >) ... 2 more > Caused by: javax.xml.bind.MarshalException > - with linked exception: > [java.io.IOException: Error writing request body to server] > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:2 >97) at > com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java >:221) at > javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshall >erImpl.java:70) at > org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder. >java:360) at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.jav >a:187) ... 10 more > Caused by: java.io.IOException: Error writing request body to server > at > sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.chec >kError(HttpURLConnection.java:2261) at > sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.writ >e(HttpURLConnection.java:2244) at > org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOut >putStream.java:45) at > org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputS >tream.java:64) at > com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.flushBuffer(UTF8XmlOu >tput.java:351) at > com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.ja >va:304) at > com.sun.xml.bind.v2.runtime.unmarshaller.Base64Data.writeTo(Base64Data >.java:263) at > com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.ja >va:251) at > com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.ja >va:312) at > com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$PcdataImpl.w >riteLeafElement(RuntimeBuiltinLeafInfoImpl.java:140) at > com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransd >ucedAccessorImpl.writeLeafElement(TransducedAccessor.java:214) at > com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.seriali >zeBody(SingleElementLeafProperty.java:62) at > com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanI >nfoImpl.java:286) at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer >.java:619) at > com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.seriali >zeBody(SingleElementNodeProperty.java:113) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Elemen >tBeanInfoImpl.java:98) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Elemen >tBeanInfoImpl.java:127) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementB >eanInfoImpl.java:244) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementB >eanInfoImpl.java:251) at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementB >eanInfoImpl.java:33) at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.ja >va:461) at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:2 >92) ... 14 more > > > Thanks, > Tor -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
