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

Solutions on the web

via Stack Overflow by Ajay Yadav
, 2 years ago
Connection timed out: connect
via wordpress.com by Unknown author, 1 year ago
connect: Address is invalid on local machine, or port is not valid on remote machine
via Oracle Community by 22b0e2af-f3a3-4cf2-8718-cdafa95404ef, 1 year ago
via Google Groups by Gary, 7 months ago
Connection refused: connect
via Google Groups by Gary Frederick, 7 months ago
java.net.ConnectException: Connection refused: 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 java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)

Users with the same issue

2 times, 16 minutes ago
332 times, 2 hours ago
39 times, 1 week ago
Once, 1 month ago
91 times, 1 month ago

Write tip

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