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

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地址即可。

时间: 2024-10-07 21:03:14

Android客户端连接tomcat时出错:connect failed: ECONNREFUSED (Connection refused)的相关文章

android 中Network error IOException: failed to connect to /127.0.0.1 (port 1433): connect failed: ECONNREFUSED (Connection refused)

下面对android中出现的Network error IOException: failed to connect to /127.0.0.1 (port 1433): 做一下总结: 当用android程序调用本地的sqlserver的时候,当连接ip写成127.0.0.1的时候,怎么都连不通,出现以下的错误信息: 感觉好像是代码有问题或者是清单文件中某个权限忘加了,其实不是这样的.原来模拟器默认把127.0.0.1和localhost当做本身了,在模拟器上可以用10.0.2.2代替127.0

【nginx】kevent() reported that connect() failed (61: Connection refused)

访问php页面时,nginx报如下错误 2014/12/25 12:36:13 [error] 3846#0: *3 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "f

nginx connect() failed (111: Connection refused) while connecting to upstream,请求无响应错误

2015/01/02 16:01:36 [error] 29002#0: *714153 connect() failed (111: Connection refused) while connecting to upstream, client: 172.16.3.32, server: bizorder.qianbao666.com, request: "POST /api/queryOrder/orderList HTTP/1.1", upstream: "http:

connect() failed (111: Connection refused) while connecting to upstream

配置好lamp后,在浏览器中运行程序后,出现上面的错误. 转自:http://www.xuejiehome.com/blread-1828.html I'm experiencing 502 gateway errors when accessing a PHP file in a directory (http://domain.com/dev/index.php), the logs simply says this: 2011/09/30 23:47:54 [error] 31160#0:

问题:connect() failed (111: Connection refused) while connecting to upstream

问题描述: 服务器重启之后,服务器也正常运行,发现网站访问不了,后来查看nginx 错误日志(/var/log/nginx/error.log ) 2016/05/13 10:47:32 [error] 7688#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: ****.****.****.33, server: , request: "GET url HTTP/1.1&

nginx和php-fpm配置 错误connect() failed (111: Connection refused) while connecting to upstream connect() to unix:/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream

若fpm配置文件中配置如下: listen = 127.0.0.1:9000 则对应的nginx.conf中的配置应为: fastcgi_pass 127.0.0.1:9000; 此时开启9000端口监听,不会生成sock文件 若fpm中的配置为使用Unix套接字,如下: listen = /run/php/php7.2-fpm.sock 则对应nginx.conf中的配置应为: fastcgi_pass unix:/run/php/php7.2-fpm.sock; 此时9000端口未开启,在/

connect() failed (111: Connection refused) while connecting to upstream报错处理

新lnmp环境调试项目时,nginx报错如下: 解决: 发现php-fpm.conf是以套接字方式通信,而nginx是以端口方式通信,见下图: 将nginx.conf修改为如下,重新reload即可 原文地址:https://www.cnblogs.com/godfather007/p/10596265.html

Android SDK Manager 更新时的“https://dl-ssl.google.com refused”错误

Android SDK Manager 消除SDK更新时的“https://dl-ssl.google.com refused”错误 消除SDK更新时,有可能会出现这样的错误:Download interrupted: hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com>Download interrupted: Connection to https://dl-ssl.googl

tomcat停止失败 java.net.ConnectException: Connection refused

今天遇到个很郁闷的问题,使用catalina.sh stop 或者 shutdown.sh 关闭tomcat总是失败,总提示连接超时. 开始以为是自己tomcat配置的问题,重新部署上没更改过配置的tomcat,结果依然是失败. 后来使用telnet 127.0.0.1 到shutdown的端口 发现失败: tomcat停止的时候将SHUTDOWN指令发送给127.0.0.1:8005端口执行: 问题原来出在自己之前测试的时候把配置有127.0.0.1 IP的lo网卡给禁用了: 启用lo网卡,然