Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How does java net SocketException Connection reset happen

We are seeing frequent Connection reset errors in our logs for a component that calls a third party Web service that sends SMS messages.

Our application is written in Java and runs on top of Tomcat 5.5. It was written by contractors who are no longer with us. The current team has no real Java expertise, and we are unsure as to where the Connection reset error is actually coming from, and how to go about debugging.

The issue appears to be completely intermittent, and unrelated to the messages we are attempting to send.

Any suggestions on what the typical causes of this exception might be, and how we might proceed, are welcome.

The whole call stack is included below for completeness.

(com.companyname.mtix.sms is our component) Connection reset
at org.apache.commons.httpclient.HttpParser.readRawLine(
at org.apache.commons.httpclient.HttpParser.readLine(
at org.apache.commons.httpclient.HttpConnection.readLine(
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(
at org.apache.commons.httpclient.HttpMethodBase.readResponse(
at org.apache.commons.httpclient.HttpMethodBase.execute(
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(
at org.apache.commons.httpclient.HttpClient.executeMethod(
at org.apache.commons.httpclient.HttpClient.executeMethod(
at sun.reflect.GeneratedMethodAccessor203.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.axis.strategies.InvocationStrategy.visit(
at org.apache.axis.SimpleChain.doVisiting(
at org.apache.axis.SimpleChain.invoke(
at org.apache.axis.handlers.soap.SOAPService.invoke(
at org.apache.axis.server.AxisServer.invoke(
at org.apache.axis.transport.http.AxisServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at org.apache.axis.transport.http.AxisServletBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at com.companyname.mtix.sms.http.filters.NoCacheFilter.doFilter(

1 Answer

This error happens on your side and NOT the other side. If the other side reset the connection, then the exception message should say: reset by peer

The cause is the connection inside HttpClient is stale. Check stale connection for SSL does not fix this error. Solution: dump your client and recreate.

Login / Signup to Answer the Question.