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.

Comments:

java.net.SocketException: Software caused connection abort: recv failed

Posted by Govind on September 19, 2007 at 11:12 PM 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 12:21 AM CEST #

Software caused connection abort :socket write error

client to gps monitor system center !

Posted by Handan on April 09, 2008 at 10:18 PM 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 11, 2008 at 10:43 PM 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 09:43 AM 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 08:56 AM CET #

Thank you for the information.
http://www.cebeci.info

Posted by new software on June 09, 2009 at 03:45 PM CEST #

Much of the above is incorrect. If the peer closes the connection the exception will read 'connection closed by peer'. This one reads 'software caused connection abort'. Different thing. See http://forums.sun.com/thread.jspa?threadID=748677 for the correct explanation of that.

Posted by Esmond Pitt on April 01, 2010 at 03:07 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

oleksiys

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today