java.net.SocketException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by Grzegorz Grzybek,
  • 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.
    via by Grzegorz Grzybek,
  • Deleting a message from a folder....
    via by 843830,
  • how to read email using java?
    via Stack Overflow by Indranil Ghosh
    ,
  • Help! - Socket read failed (Windows 95)
    via by Jo...@file.demon.co.uk,
  • HttpProxyServlet
    via by Ravi,
    • 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)

    Users with the same issue

    Agócs TamásAgócs Tamás
    259 times, last one,
    tvrmsmithtvrmsmith
    1 times, last one,
    Михайло ТітовМихайло Тітов
    1 times, last one,
    rocdayrocday
    1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    104 more bugmates