org.apache.http.conn.HttpHostConnectException: Connection to http://172.20.38.143 refused

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

The system selects automatically a group owner. The owner is always 192.168.49.1, and maybe it's trying to connect to itself. If you want to select an owner yourself, you can change the value of ownerIntent, more on this here: https://goo.gl/DGEh7K

,
Expert tip

If you're using Retrofit, check if the page you're trying to access doesn't redirect you somewhere else, as it seems to this exception.

Solutions on the web

via Stack Overflow by nawara
, 2 years ago
via Stack Overflow by timestron
, 1 year ago
Connection to http://192.168.1.135:9000 refused
via Stack Overflow by ranjith
, 2 years ago
Connection to http://192.168.1.1:8080 refused
via Stack Overflow by Hassy
, 2 years ago
Connection to <a href="http://127.0.0.1" rel="nofollow">http://127.0.0.1</a> refused
via xda-developers.com by Unknown author, 1 year ago
org.apache.http.conn.HttpHostConnectException: Connection to http://172.20.38.143 refused
at libcore.io.Posix.connect(Native Method)
at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85)
at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
at libcore.io.IoBridge.connect(IoBridge.java:112)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
at java.net.Socket.connect(Socket.java:848)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:674)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:511)
at nineandroid.net.example.library.JSONParser.getJSONFromUrl(JSONParser.java:42)
at nineandroid.net.example.library.UserFunctions.registerUser(UserFunctions.java:59)
at nineandroid.net.example.RegisterActivity$1.onClick(RegisterActivity.java:52)
at android.view.View.performClick(View.java:3567)
at android.view.View$PerformClick.run(View.java:14224)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4517)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)

Users with the same issue

2 times, 7 months ago
11 times, 2 months ago
12 times, 1 year ago
2 times, 1 month ago
40 times, 1 year ago
26 more bugmates

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