0

I am facing a strange problem.

I am trying to access a server from Samsung Galaxy Nexus. Things work fine most of the times, however I have observed that sometimes, the application running on the mobile is not able to connect to the server, below is the exception trace.

When this scenario occurs, the application is not able to reach the server consistently. Once when this issue was reproduced, I tried opening the URL in the browser on the phone, and the URL opened. However, in the application, we were still facing issues. I force stopped the application and started again, still the same issue. Ultimately, I had to reset my wifi and post that, everything worked fine.

Please note that the actual URL mentioned here has been hidden for confidentiality issues.

Any comments please?

Regards,

----- logs start

WARNING: (2160,e,ProtocolObjectHTTP)http EX:ConnectExceptionfailed to

connect to abc-def.csrlbs.com/50.19.101.191 (port 80): connect failed: ETIMEDOUT (Connection timed out) java.net.ConnectException: failed to connect to abc-def.csrlbs.com/50.19.101.191 (port 80): connect failed: ETIMEDOUT (Connection timed out) at libcore.io.IoBridge.connect(IoBridge.java:114) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459) at java.net.Socket.connect(Socket.java:842) at libcore.net.http.HttpConnection.(HttpConnection.java:76) at libcore.net.http.HttpConnection.(HttpConnection.java:50) at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340) at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87) at libcore.net.http.HttpConnection.connect(HttpConnection.java:128) at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316) at libcore.net.http.HttpEngine.connect(HttpEngine.java:311) at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290) at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240) at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81) at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197) at com.sirf.pal.android.ProtocolObjectHTTP.a(SourceFile:138) at com.sirf.pal.android.e.a(SourceFile:265) at com.sirf.pal.android.ProtocolObjectHTTP.run(SourceFile:524) at java.lang.Thread.run(Thread.java:856) Caused by: libcore.io.ErrnoException: connect failed: ETIMEDOUT (Connection timed out) 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) ... 18 more

Nov 28, 2012 12:00:50 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostException wait completed1 Nov 28, 2012 12:00:50 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

Nov 28, 2012 12:00:51 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostException wait completed2 Nov 28, 2012 12:00:51 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

Nov 28, 2012 12:00:52 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostException wait completed3 Nov 28, 2012 12:00:52 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

Nov 28, 2012 12:00:52 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

Nov 28, 2012 12:00:54 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostException wait completed1 Nov 28, 2012 12:00:54 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

Nov 28, 2012 12:00:55 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostException wait completed2 Nov 28, 2012 12:00:55 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

Nov 28, 2012 12:00:56 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostException wait completed3 Nov 28, 2012 12:00:56 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

Nov 28, 2012 12:00:56 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

Nov 28, 2012 12:00:57 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostException wait completed1 Nov 28, 2012 12:00:57 PM com.sirf.pal.android.d a WARNING: (2160,e,ProtocolObjectHTTP)http UnknownHostExceptionUnable to resolve host "abc-def.csrlbs.com": No address associated with hostname

----- logs end

Robin
  • 497
  • 5
  • 19
  • maybe you mistyped host address abc-def.csrlbs.com. Did you put http:// infront ? Try to call it from browser – v0d1ch Nov 28 '12 at 07:28
  • The changes mentioned in this answer may solve your problem. http://stackoverflow.com/questions/12607332/android-unknownhostexception-facebook-sdk/13560062#13560062 – MKJParekh Nov 28 '12 at 07:53
  • vodich, I have already mentioned that the the IP is hidden for confidentiality issues here. Plus I have already mentioned that it was accessible from the browser. – Robin Nov 28 '12 at 10:28

1 Answers1

0

(1) Please check that you have added the following android permissions

<uses-permission android:name="android.permission.INTERNET" />
</manifest>

(2) There is a known issue in android if underscores are used in your domain. Verify that your domain does not use underscores.Having a underscore in a domain is invalid and will throw an unknown host exception.

(3) Check your internet connection is ON and can access the domain name from your device.

Kusal Dissanayake
  • 714
  • 14
  • 32