javax.mail.MessagingException: Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect


Samebug tips

Check if your server (or a proxy server) is not going up and down. There might be something between a proxy and a client sending intermittent requests to non-functioning hosts as well. There might as well be too many requests in a short amount of time.


3 months ago
Expert tip

Check if ip adress is correct, if the port is correct, and if the server is up and running and waiting for connections. Also, check if there's no firewall blocking you and if your internet connection is working.


7 months ago
Expert tip

Solutions on the web

Solution icon of stackoverflow
Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect

Solution icon of coderanch
via Coderanch by geeu mom, 10 months ago
Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect

Solution icon of jasig
via Apereo Issues by Drew Wills, 1 year ago
Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect

Solution icon of coderanch
via Coderanch by Andrew Vyas, 10 months ago
Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect

Solution icon of coderanch
Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect

Solution icon of stackoverflow
Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect

Solution icon of stackoverflow
Connection timed out: connect; jvm 1 | nested exception is: jvm 1 | java.net.ConnectException: Connection timed out: connect

Solution icon of stackoverflow
Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect

Solution icon of stackoverflow
Connection timed out: connect; nested exception is:java.net.ConnectException: Connection timed out: connect

Solution icon of coderanch
via Coderanch by Nila dhan, 10 months ago
Connection refused: connect; nested exception is: java.net.ConnectException: Connection refused: connect

Stack trace

javax.mail.MessagingException: Connection timed out: connect;
  nested exception is:
    java.net.ConnectException: Connection timed out: connect
	at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:670)
	at javax.mail.Service.connect(Service.java:295)
	at usingJavaMail.OutlookReader_imap.<init>(OutlookReader_imap.java:45)
	at usingJavaMail.OutlookReader_imap.main(OutlookReader_imap.java:126)
Caused by: java.net.ConnectException: Connection timed out: connect
	at java.net.DualStackPlainSocketImpl.connect0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
	at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:207)
	at com.sun.mail.iap.Protocol.<init>(Protocol.java:113)
	at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:111)
	at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:637)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
1009 more bugmates