3 Replies Latest reply on Sep 2, 2015 6:23 AM by asoldano

    cxf multipart requests are "400 Bad Request".

    whitingjr

      Hi,

      I am investigating the cause of errors in the server.log when running a benchmark.

       

      On the client side I tried two app servers runtimes. EAP 6.4.0.GA and Wildfly 9.0.1.Final. On the server side I tried EAP 6.4.0.GA and Wildfly 9.0.0.

      I have been using Wireshark to inspect traces of the HTTP traffic.

       

      On the client I see these errors. Roughly 1 every second.

       

       

      10:33:54,486 ERROR [stderr] (pool-5-thread-5) javax.xml.ws.WebServiceException: Could not send Message.

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:149)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at com.sun.proxy.$Proxy66.processDeliveryAttach(Unknown Source)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.acme.enterprise.supplier.emulator.DeliveryHandler.deliverAttachment(DeliveryHandler.java:265)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.acme.enterprise.supplier.emulator.DeliveryHandler.deliver(DeliveryHandler.java:181)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.acme.enterprise.supplier.emulator.DeliveryHandler.run(DeliveryHandler.java:133)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at java.util.concurrent.FutureTask.run(FutureTask.java:266)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at java.lang.Thread.run(Thread.java:745)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5) Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '400: Bad Request' when communicating with http://serversomewhere:8081/supplier/AppyService

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1581)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1533)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1336)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138)

      10:33:54,487 ERROR [stderr] (pool-5-thread-5)   ... 11 more

      10:33:54,490 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (pool-5-thread-6) Interceptor for {org:acme:enterprise:ws:buyer}AppyService#{org:acme:enterprise:ws:buyer}ProcessDeliveryAttach has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Could not send Message.

              at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)

              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)

              at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)

              at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)

              at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)

              at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)

              at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)

              at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138)

              at com.sun.proxy.$Proxy65.processDeliveryAttach(Unknown Source)

              at org.acme.enterprise.supplier.emulator.DeliveryHandler.deliverAttachment(DeliveryHandler.java:265) [classes:]

              at org.acme.enterprise.supplier.emulator.DeliveryHandler.deliver(DeliveryHandler.java:181) [classes:]

              at org.acme.enterprise.supplier.emulator.DeliveryHandler.run(DeliveryHandler.java:133) [classes:]

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_45]

              at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45]

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [rt.jar:1.8.0_45]

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [rt.jar:1.8.0_45]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]

      Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '400: Bad Request' when communicating with http://serversomewhere:8081/appy/AppyService

              at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1581)

              at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1533)

              at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1336)

              at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)

              at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652)

              at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)

              ... 18 more

       

       

      I see [JBWS-3857] Wrong content type (text/xml) in outgoing multipart SOAPMessage (expected multipart/related; ...) - JBoss Is… fixed in jbossws-cxf-5.0.0.Beta3. But not certain this is relevant as the failed requests happen for

       

      I tried configuring the CXF client to disable chunking to see if it solved the problem. Using this configuration in Wildfly. But made no difference to chunking. The request still is chunked and the error persists.

       

      <client-config name="Standard-Client-Config">

         <property name="cxf.client.allowChunking" value="false"/>

      </client-config>

       

      Any suggestions on diagnosing the problem ?