cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Liu (JIRA)" <>
Subject [jira] [Created] (CXF-3570) HTTPConduit reads response before it completes sending request
Date Tue, 07 Jun 2011 10:53:58 GMT
HTTPConduit reads response before it completes sending request

                 Key: CXF-3570
             Project: CXF
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.4
            Reporter: David Liu
            Priority: Critical


  In CXF 2.4, HTTP Conduit has a new debug log as below. However, this logging message can
cause HTTPConduit reads the  response before it completes sending request, and it results
in an IOException in the client side.
  The reason is that the method *connection.getContentType()* will trigger httpconnect to
send current data to the HttpServer and want the server to return the response, so the server
thinks the client complete the whole request and the server just reply nothing and closes
the http connection.

Code in
        protected void onFirstWrite() throws IOException {
            if (LOG.isLoggable(Level.FINE)) {
                LOG.fine("Sending "
                    + connection.getRequestMethod() 
                    + " Message with Headers to " 
                    + connection.getURL()
                    + " Conduit :"
                    + conduitName
                    + "\nContent-Type: " + connection.getContentType() + "\n");

  To reproduce the issue: please create a simple web service in cxf 2.4 and enable its debug
log, and then use a generated proxy client to call the http service, then you can see the
error below.


Caused by: IOException invoking http://localhost:7777/Hello: Stream is
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
	at org.apache.cxf.transport.AbstractConduit.close(
	at org.apache.cxf.transport.http.HTTPConduit.close(
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.frontend.ClientProxy.invokeSync(
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(
	... 2 more


This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message