java.net.ConnectException: Connection refused: connect

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

Firewall might be blocking your connection, or MySQL it's not running on your server machine.

,
Expert tip

Check if you have started your server, or if your server is set to listen to the port you're trying to connect and is waiting to accept connections and check if the firewall isn't blocking your connection.

Solutions on the web

via Google Groups by Unknown author, 8 months ago
Connection timed out: connect
via Oracle Community by Kamal289, 1 year ago
Connection timed out: connect
via Stack Overflow by Unknown author, 2 years ago
Connection timed out: connect
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.connect.socket.TestConnection.main(TestConnection.java:23)

Users with the same issue

54 times, 2 days ago
Samebug visitor profile picture
Unknown user
Once, 4 days ago
Samebug visitor profile picture
Unknown user
Once, 2 weeks ago
2 times, 1 month ago
2604 times, 2 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.