Official reasons for “Software caused connection abort: socket write error”

后端 未结 14 1984
别跟我提以往
别跟我提以往 2020-11-21 07:21

Given this stack trace snippet

Caused by: java.net.SocketException: Software caused connection abort: socket write error
&nbs

相关标签:
14条回答
  • 2020-11-21 08:04

    Closed connection in another client

    In my case, the error was:

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

    It was received in eclipse while debugging a java application accessing a H2 database. The source of the error was that I had initially opened the database with SQuirreL to check manually for integrity. I did use the flag to enable multiple connections to the same DB (i.e. AUTO_SERVER=TRUE), so there was no problem connecting to the DB from java.

    The error appeared when, after a while --it is a long java process-- I decided to close SQuirreL to free resources. It appears as if SQuirreL were the one "owning" the DB server instance and that it was shut down with the SQuirreL connection.

    Restarting the Java application did not yield the error again.

    config

    • Windows 7
    • Eclipse Kepler
    • SQuirreL 3.6
    • org.h2.Driver ver 1.4.192
    0 讨论(0)
  • 2020-11-21 08:05

    I was facing the same problem with wireMock while mocking the rest API calls. Earlier I was defining the server like this:

    WireMockServer wireMockServer = null;
    

    But it should be defined like as shown below:

    @Rule 
    public WireMockRule wireMockRule = new WireMockRule(8089);
    
    0 讨论(0)
  • 2020-11-21 08:07

    This error can occur when the local network system aborts a connection, such as when WinSock closes an established connection after data retransmission fails (receiver never acknowledges data sent on a datastream socket).

    See this MSDN article. See also Some information about 'Software caused connection abort'.

    0 讨论(0)
  • 2020-11-21 08:08

    ssl client side will throw such exception in below situation(I had tested), :

    server is asked to authenticate client certificate, but the client provide a certificate which Extended Key Usage donot support client auth.

    0 讨论(0)
  • 2020-11-21 08:09

    I have seen this most often when a corporate firewall on a workstation/laptop gets in the way, it kills the connection.

    eg. I have a server process and a client process on the same machine. The server is listening on all interfaces (0.0.0.0) and the client attempts a connection to the public/home interface (note not the loopback interface 127.0.0.1).

    If the machine is has its network disconnected (eg wifi turned off) then the connection is formed. If the machine is connected to the corporate network (directly or vpn) then the connection is formed.

    However, if the machine is connected to a public wifi (or home network) then the firewall kicks in an kills the connection. In this situation connecting the client to the loopback interface works fine, just not to the home/public interface.

    Hope this helps.

    0 讨论(0)
  • 2020-11-21 08:19

    For anyone using simple Client Server programms and getting this error, it is a problem of unclosed (or closed to early) Input or Output Streams.

    0 讨论(0)
提交回复
热议问题