`
chenhua_1984
  • 浏览: 1266213 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

Android客户端连接tomcat时出错:connect failed: ECONNREFUSED (Connection refused),econnref

阅读更多

Android客户端连接tomcat时出错:connect failed: ECONNREFUSED (Connection refused),econnrefused

 

public static final String BASE_URL = "http://127.0.0.1:8090/HelloWord/"...;

会抛异常Caused by: libcore.io.ErrnoException: connect failed: ECONNREFUSED (Connection refused)

 

解决方法:

String url = "http://127.0.0.1:8090/HelloWord/"...;  修改成

public static final String BASE_URL = "http://192.168.3.14:8090/HelloWord"...;

主机ip不能使用localhost或者127.0.0.1,使用真实ip地址即可。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics