Mytec
Strange "Software caused connection abort: recv failed"
Recently I was investigating Grizzly related bug, which appeared when Grizzly tried to redirect (HTTP response code 302) Java HTTPS client. And the bug appeared only in situations, when client tried to send some payload data to server, not just HTTP headers.
Finally I realize, that it has nothing to do neither with Grizzly nor HTTPS/SSL. Following scenario fully reproduces the problem with clear Sockets:
1) Client -> Server: client sends request chunk#1
2) Server -> Client: server reads chunk#1, processes, writes response
3) Server closes connection
4) Client -> Server: client sends request chunk#2
5) Client tries to read server response: "java.net.SocketException: Software caused connection abort: recv failed"
As the result client will not be able to read any byte from server's response!
What is interesting on step (4) we don't see any exception, but this step (sending data over connection, which is closed by peer) is the reason of the exception we're getting on (5). Removing step (4) from our scenario, or putting it before step (3) - makes everything work.
Actual exception looks strange for me, as it is thrown not from the place, which causes the problem.
Posted at 02:22PM Jun 13, 2007 by oleksiys in Sun | Comments[7]
java.net.SocketException: Software caused connection abort: recv failed
Posted by Govind on September 20, 2007 at 06:12 AM CEST #
Absolutely right, I am confronted by
this problem when try to realize multithread client whith symply blocking socket. I think it is JVM error, because there is some code in SocketInputStream class to solve this problem:
/*
* We receive a "connection reset" but there may be bytes still
* buffered on the socket
*/
if (gotReset) {
impl.setConnectionResetPending();
impl.acquireFD();
try {
n = socketRead0(fd, b, off, length, impl.getTimeout());
if (n > 0) {
return n;
}
} catch (ConnectionResetException rstExc) {
} finally {
impl.releaseFD();
}
}
Posted by Vahan on October 02, 2007 at 07:21 AM CEST #
Software caused connection abort :socket write error
client to gps monitor system center !
Posted by Handan on April 10, 2008 at 05:18 AM CEST #
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.net.SocketInputStream.read(SocketInputStream.java:90)
at com.zjx.gps.GpsSocket.getRecord(GpsSocket.java:51)
at getLatLon.SendData(getLatLon.java:100)
at getLatLon.doGet(getLatLon.java:35)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Posted by Handan on April 12, 2008 at 05:43 AM CEST #
Hi,
recently I have the same problem. My client application was behind a firewall.
Tha axis2 requires the explicit declaration of the Proxy server in the service descriptor axis2.xml at client side.
I found the solution at the site:
http://www.keith-chapman.org/2008/10/how-to-run-axis2-behind-proxy-and.html
Now, that problem was solved.
[]'s,
A P
Posted by A P on October 22, 2008 at 04:43 PM CEST #
I have same problem, but no of these answers above didnt help me, and I dont know still how to resolve it! any other idea?
Posted by Petr on November 12, 2008 at 04:56 PM CET #
Thank you for the information.
http://www.cebeci.info
Posted by new software on June 09, 2009 at 10:45 PM CEST #