An error occurred when the Android client connected Tomcat: Connect failed:econnrefused (Connection refused), econnrefused
public static final String Base_url = "http://127.0.0.1:8090/HelloWord/" ...;
Will throw an exception caused By:libcore.io.ErrnoException:connect failed:econnrefused (Connection refused)
Workaround:
String url = "http://127.0.0.1:8090/HelloWord/" ...; Modified into
public static final String Base_url = "Http://192.168.3.14:8090/HelloWord" ...;
Host IP cannot use localhost or 127.0.0.1, using a real IP address.
At the beginning of the Tomcat Times javanetconnectexception:connection Refused:connect
ServerSocket monitoring is not created.
Run cmd
Input Netstat-nao
Find your ServerSocket listening port and see if it opens.
In the stop Tomcat Times javanetconnectexception:connection Refused:connect
Tomcat forced off is very easy to damage, will report some inexplicable errors, but still can use. We usually can use it, no matter what he does.
Android encounters a problem in this record