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

mulesoft.org | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Problems with POP3 Message Receiver due to connection reset in one particular moment. In {{org.mule.providers.email.RetrieveMessageReceiver.poll()}} method, after succesfully opening the folder and retrieving the number of messages: {code} if (!folder.isOpen()) { folder.open(Folder.READ_WRITE); } //... int count = folder.getMessageCount(); if (count > 0) { {code} when the connection to pop3 server is closed, {{com.sun.mail.pop3.POP3Folder.getMessages()}} causes closing POP3Store, because of this simple exception: {code} 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.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at java.io.DataInputStream.readLine(DataInputStream.java:473) at com.sun.mail.pop3.Protocol.simpleCommand(Protocol.java:347) at com.sun.mail.pop3.Protocol.noop(Protocol.java:322) at com.sun.mail.pop3.POP3Store.isConnected(POP3Store.java:176) at com.sun.mail.pop3.POP3Folder.isOpen(POP3Folder.java:260) at javax.mail.Folder.getMessages(Folder.java:924) {code} Then there is an {{IllegalStateException}} in the following code: {code} try { folder.close(true); // close and expunge deleted messages } catch (Exception e) { logger.error("Failed to close pop3 inbox: " + e.getMessage()); } {code} because the folder *and* the store have been {{closed()}}. Now, when the connection to POP3 server is back, the folder is succesfully opened: {code} folder.open(Folder.READ_WRITE); {code} but {{getMessages()}} throws an {{java.lang.IllegalStateException}}, because {{POP3Store}} is still closed. {{RetrieveMessageReceiver}} is not able to perform reconnection, because {{getMessages()}} throws {{IllegalStateException}} instead of {{MessagingException}} and {{handleException()}} is never called. It still wouldn't change anything, because {{IllegalStateException}} is not *instanceof* {{org.mule.providers.ConnectException}}. Please add some method of performing reconnection in case of such error.

    MuleSoft JIRA | 9 years ago | Grzegorz Grzybek
    java.net.SocketException: Software caused connection abort: recv failed
  2. 0

    Problems with POP3 Message Receiver due to connection reset in one particular moment. In {{org.mule.providers.email.RetrieveMessageReceiver.poll()}} method, after succesfully opening the folder and retrieving the number of messages: {code} if (!folder.isOpen()) { folder.open(Folder.READ_WRITE); } //... int count = folder.getMessageCount(); if (count > 0) { {code} when the connection to pop3 server is closed, {{com.sun.mail.pop3.POP3Folder.getMessages()}} causes closing POP3Store, because of this simple exception: {code} 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.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at java.io.DataInputStream.readLine(DataInputStream.java:473) at com.sun.mail.pop3.Protocol.simpleCommand(Protocol.java:347) at com.sun.mail.pop3.Protocol.noop(Protocol.java:322) at com.sun.mail.pop3.POP3Store.isConnected(POP3Store.java:176) at com.sun.mail.pop3.POP3Folder.isOpen(POP3Folder.java:260) at javax.mail.Folder.getMessages(Folder.java:924) {code} Then there is an {{IllegalStateException}} in the following code: {code} try { folder.close(true); // close and expunge deleted messages } catch (Exception e) { logger.error("Failed to close pop3 inbox: " + e.getMessage()); } {code} because the folder *and* the store have been {{closed()}}. Now, when the connection to POP3 server is back, the folder is succesfully opened: {code} folder.open(Folder.READ_WRITE); {code} but {{getMessages()}} throws an {{java.lang.IllegalStateException}}, because {{POP3Store}} is still closed. {{RetrieveMessageReceiver}} is not able to perform reconnection, because {{getMessages()}} throws {{IllegalStateException}} instead of {{MessagingException}} and {{handleException()}} is never called. It still wouldn't change anything, because {{IllegalStateException}} is not *instanceof* {{org.mule.providers.ConnectException}}. Please add some method of performing reconnection in case of such error.

    MuleSoft JIRA | 9 years ago | Grzegorz Grzybek
    java.net.SocketException: Software caused connection abort: recv failed
  3. 0

    [MULE-2624] Problems reconnecting to POP3 server - JIRA

    mulesoft.org | 6 months ago
    java.net.SocketException: Software caused connection abort: recv failed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Deleting a message from a folder....

    Oracle Community | 1 decade ago | 843830
    java.net.SocketException: Software caused connection abort: recv failed
  6. 0

    How to call Web services from BPEL process through a proxy

    Oracle Community | 6 years ago | 828316
    java.net.SocketException: Software caused connection abort: recv failed

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.net.SocketException

      Software caused connection abort: recv failed

      at java.net.SocketInputStream.socketRead0()
    2. Java RT
      DataInputStream.readLine
      1. java.net.SocketInputStream.socketRead0(Native Method)
      2. java.net.SocketInputStream.read(SocketInputStream.java:129)
      3. java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
      4. java.io.BufferedInputStream.read(BufferedInputStream.java:235)
      5. java.io.DataInputStream.readLine(DataInputStream.java:473)
      5 frames
    3. JavaMail API (compat)
      POP3Folder.isOpen
      1. com.sun.mail.pop3.Protocol.simpleCommand(Protocol.java:347)
      2. com.sun.mail.pop3.Protocol.noop(Protocol.java:322)
      3. com.sun.mail.pop3.POP3Store.isConnected(POP3Store.java:176)
      4. com.sun.mail.pop3.POP3Folder.isOpen(POP3Folder.java:260)
      4 frames
    4. JavaMail API
      Folder.getMessages
      1. javax.mail.Folder.getMessages(Folder.java:924)
      1 frame