java.net.ConnectException: fail to connect to localhost/127.0.0.1(port 8080): connect failed:ECONNREFUSED….(Android problem)

5,278 views
Skip to first unread message

Yahya-Imam Munir

unread,
Apr 23, 2016, 9:03:05 AM4/23/16
to CodenameOne Discussions
Hi,
   After sending the app for Android build, I scanned the generated QRcode and install the application on galaxy s4 successfully. But when i try to do some search using the app i got the following exception "java.net.ConnectException: fail to connect to localhost/127.0.0.1(port 8080): connect failed:ECONNREFUSED…." Please check the attached picture for more clarity. 
The app works correctly on simulator. I OFF the firewall of my system but that doesn't solve the issue. 
Please how can I solve this problem?


This issue applies to:
NetBeans 8.0.2
GlassFish Server 4.1
Windows 7
Device: Samsung Galaxy S4


Best regards,
Yahya-Imam Munir Kolapo
C.png

David Wafula

unread,
Apr 23, 2016, 2:32:57 PM4/23/16
to CodenameOne Discussions
It will work on the simulator because the server and the app are both running on same computer.   So before you sent the build, change the 127.0.0.1/localhost to the IP of your computer; am assuming that is where the app is supposed to connect to. Again, unless the phone  connects to same LAN as the server, you might not be lucky. Run the server on public IP and it will connect.


--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/62128469-1bdd-412a-abc3-01227c4097c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
David W

Yahya-Imam Munir

unread,
Apr 28, 2016, 5:39:09 AM4/28/16
to CodenameOne Discussions
Hi davidwaf,  thank you for the enlightenment and support. Yes i replaced the 127.0.0.1/localhost with the IP address of the system and the exception disappeared. I'm currently researching on public ip and noip in other to make my server public


On Sunday, April 24, 2016 at 2:32:57 AM UTC+8, davidwaf wrote:
It will work on the simulator because the server and the app are both running on same computer.   So before you sent the build, change the 127.0.0.1/localhost to the IP of your computer; am assuming that is where the app is supposed to connect to. Again, unless the phone  connects to same LAN as the server, you might not be lucky. Run the server on public IP and it will connect.

On Sat, Apr 23, 2016 at 3:03 PM, Yahya-Imam Munir <mk.yah...@gmail.com> wrote:
Hi,
   After sending the app for Android build, I scanned the generated QRcode and install the application on galaxy s4 successfully. But when i try to do some search using the app i got the following exception "java.net.ConnectException: fail to connect to localhost/127.0.0.1(port 8080): connect failed:ECONNREFUSED…." Please check the attached picture for more clarity. 
The app works correctly on simulator. I OFF the firewall of my system but that doesn't solve the issue. 
Please how can I solve this problem?


This issue applies to:
NetBeans 8.0.2
GlassFish Server 4.1
Windows 7
Device: Samsung Galaxy S4


Best regards,
Yahya-Imam Munir Kolapo

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.



--
David W
Reply all
Reply to author
Forward
0 new messages