Hi everyone

I am a beginner in the android sphere I have been using android studio for 
a couple of months now after moving from eclipse.

How I setup my environment is that I run my backend service using netbeans 
8.0.1 and glassfish 4.1 the service is using websockets, I have done a 
service previously that has run successfully.

I can access the service using my web browser: 
http://localhost:8080/projectx. Which shows me that the glassfish server is 
running.

I have been stuck for the past few days, when trying to run my project on 
android studio I cannot connect to the websocket end point, I try to 
connect using my localhost ip address. 

Logcat gives me the following stack trace:

12-10 11:41:21.768  25736-26019/com.samboga.mimi.admin D/com.com.samboga.
mimi.library.util.WebSocketUtil﹕ #### #### -------------> starting 
mWebSocketClient.connect ...
12-10 11:41:21.769  25736-26019/com.samboga.mimi.admin E/com.com.samboga.
mimi.library.util.WebSocketUtil﹕ onSessionDisconnected
12-10 11:41:24.768  25736-26036/com.samboga.mimi.admin E/com.com.samboga.
mimi.library.util.WebSocketUtil﹕ ----------> onError
    java.net.ConnectException: failed to connect to /192.168.1.25 (port 8080
): connect failed: EHOSTUNREACH (No route to host)
            at libcore.io.IoBridge.connect(IoBridge.java:124)
            at libcore.io.IoBridge.connect(IoBridge.java:110)
            at java.nio.SocketChannelImpl.connect(SocketChannelImpl.java:199
)
            at org.java_websocket.client.WebSocketClient.interruptableRun(
WebSocketClient.java:210)
            at org.java_websocket.client.WebSocketClient.run(WebSocketClient
.java:188)
            at java.lang.Thread.run(Thread.java:818)
     Caused by: android.system.ErrnoException: connect failed: EHOSTUNREACH 
(No route to host)
            at libcore.io.Posix.connect(Native Method)
            at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:111)
            at libcore.io.IoBridge.connectErrno(IoBridge.java:137)
            at libcore.io.IoBridge.connect(IoBridge.java:122)
            at libcore.io.IoBridge.connect(IoBridge.java:110)
            at java.nio.SocketChannelImpl.connect(SocketChannelImpl.java:199
)
            at org.java_websocket.client.WebSocketClient.interruptableRun(
WebSocketClient.java:210)
            at org.java_websocket.client.WebSocketClient.run(WebSocketClient
.java:188)
            at java.lang.Thread.run(Thread.java:818)



I was suspecting that there is something wrong with the network proxy that 
I am using, I have tried to stop my anti virus software, turning off my 
firewall which did not help. I am able to run other project on Android 
studio and it will connect to the endpoint on my local glassfish just fine. 
I have also created a portable hotspot with my device to see if its not a 
networks issue, the problem still persists.

I have also tried to redeploy the service using localhost:4848 which has 
not helped

The problem I am facing is ways to troubleshoot this challenge, please help 
anyone. I might be going about it the wrong way please help with pointers


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to