zach-klippenstein / captivate

A simple service for detecting wifi hotspots that ask for information (captive portals), and automatically showing the login page.
http://play.google.com/store/apps/details?id=com.zachklipp.captivate
9 stars 3 forks source link

java.net.UnknownHostException when wifi disabled and not connected to a network #12

Closed zach-klippenstein closed 12 years ago

zach-klippenstein commented 12 years ago

In InetAddress.lookupHostByName().

Stack trace:

java.lang.RuntimeException: Error executing request
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.executeRequestOrThrow(HttpResponseContentsDetector.java:80)
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.onCheckForPortal(HttpResponseContentsDetector.java:56)
at com.zachklipp.captivate.captive_portal.PortalDetector.checkForPortal(PortalDetector.java:50)
at com.zachklipp.captivate.service.PortalDetectorService.checkForPortal(PortalDetectorService.java:164)
at com.zachklipp.captivate.service.PortalDetectorService.onHandleIntent(PortalDetectorService.java:147)
at com.zachklipp.captivate.util.StickyIntentService$WorkerThread.handleMessage(StickyIntentService.java:114)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:130)
at android.os.HandlerThread.run(HandlerThread.java:60)
Caused by: java.net.UnknownHostException: www.apple.com
at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
at java.net.InetAddress.getAllByName(InetAddress.java:256)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
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:428)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.executeRequestOrThrow(HttpResponseContentsDetector.java:76)
... 8 more