axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <>
Subject [jira] [Moved] (AXIS2-5791) Issue with Axis2, jax-ws web service call - HttpClient 3.1/4 Socket Closed due to stale SSL connection, java 8
Date Wed, 22 Jun 2016 16:31:58 GMT


Andreas Veithen moved TRANSPORTS-56 to AXIS2-5791:

    Affects Version/s:     (was: 1.7.0)
          Component/s:     (was: Base)
                  Key: AXIS2-5791  (was: TRANSPORTS-56)
              Project: Axis2  (was: Axis2 Transports)

> Issue with Axis2, jax-ws web service call - HttpClient 3.1/4
Socket Closed due to stale SSL connection, java 8
> ----------------------------------------------------------------------------------------------------------------------------------------
>                 Key: AXIS2-5791
>                 URL:
>             Project: Axis2
>          Issue Type: Bug
>          Components: transports
>    Affects Versions: 1.7.0
>         Environment: Oracle Linux: 2.6.18-274.el5 x86_64, tomcat 7.0.68
>            Reporter: Jon Hargreaves
> We are in the process of upgrading an axis2 application from java 6 to java 8 and have
been running tests against existing jax-ws axis2 services.
> We have a web service, running on tomcat, that is placing a client call, also via jax-ws
to an external web service via an SSL connection.
> After switching from java 6 to java 8 we have found that the client call is still working.

> However, when placing a second call to the same web service the call fails with a "
Socket Closed" exception.
> This issue is occurring consistently, i.e. if we restart the tomcat server and then execute
the web service which places the client call, via SoapUI, the same exception is logged.
> On further analysis of the log file it seems that, on the second call, the http connection
is being returned from the cache via the httpclient MultiThreadedHttpConnectionManager class.
> The exception is logged, as below:
> DEBUG org.apache.commons.httpclient.HttpConnection  - An error occurred while reading
from the socket, is appears to be stale
> Socket Closed
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at org.apache.commons.httpclient.HttpConnection.isStale(
> 	at org.apache.commons.httpclient.HttpConnection.closeIfStale(
> 	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.closeIfStale(
> 	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(
> 	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(
> 	at org.apache.commons.httpclient.HttpClient.executeMethod(
> 	at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.executeMethod(
> 	at org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.sendViaPost(
> 	at org.apache.axis2.transport.http.HTTPSender.send(
> 	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(
> 	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
> 	at org.apache.axis2.engine.AxisEngine.send(
> It therefore seems that the remote server, to which we are placing the client jax-ws
call, is closing the connection immediately after sending the response but that the client
is not detecting this. 
> When the next web service call is placed via the client the connection is retrieved from
the connection pool, the httpclient.HttpConnection.isStale() check is performed, the connection
is not correctly detected as being stale and then the ssl.SSLSocketImpl.setSoTimeout() method
is called to reset the socket timeout, java net then detects that the connection is no longer
active and raises the socket exception.
> Note that when this issue occurs it is no longer possible to run this web service, i.e.
the socket exception is then output on every invocation of the service until the tomcat server
is restarted.
> Also, note that this issue only occurs with java 8. The socket exception is not output
with java 6.
> I have performed tests with different versions of axis2 and found that, with version
1.6.0, the same socket exception is output but that a new connection is then opened and the
web service then executes and returns a response without issue.
> Finally, I read the Apache Axis2 1.7.0 release note which states that Axis2 1.7.0 and
above supports Apache HttpClient 4.x in addition to the no longer maintained Commons HttpClient
> I have attempted to follow the instructions for upgrading the HttpClient to release 4.x
but in the log file I'm still seeing output for org.apache.commons.httpclient.HttpConnection.

> It seems that the change applied to the axis2.xml config file is not taking effect.
> Please could you help with the resolution for the socket exception issue and also give
guidance with upgrading the HttpClient to version 4.2.5.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message