java.net.ConnectException: Failed to connect to localhost/127.0.0.1:8081

Hot problem!
This exception has a lot of traffic. You can help 13 users by writing a short tip.

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 GitHub by vonovak
, 1 year ago
Failed to connect to localhost/127.0.0.1:8081
via GitHub by Korzhuck
, 1 year ago
Failed to connect to news.tut.by/178.172.160.5:80
via GitHub by TheDrHax
, 4 months ago
via GitHub by TheDrHax
, 1 year ago
via GitHub by dmitry-zhuravlev
, 1 year ago
Failed to connect to localhost/0:0:0:0:0:0:0:1:1246
via GitHub by cbeust
, 1 year ago
Failed to connect to localhost/0:0:0:0:0:0:0:1:1246
java.net.ConnectException: Failed to connect to localhost/127.0.0.1:8081
at okhttp3.internal.io.RealConnection.connectSocket(RealConnection.java:187)
at okhttp3.internal.io.RealConnection.buildConnection(RealConnection.java:170)
at okhttp3.internal.io.RealConnection.connect(RealConnection.java:111)
at okhttp3.internal.http.StreamAllocation.findConnection(StreamAllocation.java:187)
at okhttp3.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:123)
at okhttp3.internal.http.StreamAllocation.newStream(StreamAllocation.java:93)
at okhttp3.internal.http.HttpEngine.connect(HttpEngine.java:296)
at okhttp3.internal.http.HttpEngine.sendRequest(HttpEngine.java:248)
at okhttp3.RealCall.getResponse(RealCall.java:243)
at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:201)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163)
at okhttp3.RealCall.access$100(RealCall.java:30)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:127)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

Users with the same issue

2 times, 11 months ago
2 times, 11 months ago
Once, 1 year ago
2 times, 1 year ago
Once, 1 year ago

Write tip

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