我的应用程序正在使用Revovit(V1.6.1)连接到REST web服务,它无法连接到我的本地web服务器(运行在localhost
)上,这是我得到的错误。
这是在Nexus4(V4.3)模拟器中,我使用Android Studio进行开发,并且在清单文件中添加了Android.permission.internet
&Android.permission.access_network_state
权限。
错误说它等待了15秒,但它不是,它马上就错误了。
07-13 15:57:53.947 820-840/it.test.android.app.activity D/Retrofit﹕ ---> HTTP POST http://localhost:3000/app/auth/signin
07-13 15:57:54.132 820-840/it.test.android.app.activity D/Retrofit﹕ Content-Type: application/json; charset=UTF-8
07-13 15:57:54.132 820-840/it.test.android.app.activity D/Retrofit﹕ Content-Length: 44
07-13 15:57:54.157 820-840/it.test.android.app.activity D/Retrofit﹕ {"auth":{"email":"steve","password":"pass"}}
07-13 15:57:54.387 820-840/it.test.android.app.activity D/Retrofit﹕ ---> END HTTP (44-byte body)
07-13 15:57:54.657 820-840/it.test.android.app.activity D/Retrofit﹕ ---- ERROR http://localhost:3000/app/auth/signin
07-13 15:57:54.857 820-840/it.test.android.app.activity D/Retrofit﹕ java.net.ConnectException: failed to connect to localhost/127.0.0.1 (port 3000) after 15000ms: isConnected failed: ECONNREFUSED (Connection refused)
at libcore.io.IoBridge.isConnected(IoBridge.java:223)
at libcore.io.IoBridge.connectErrno(IoBridge.java:161)
at libcore.io.IoBridge.connect(IoBridge.java:112)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
at java.net.Socket.connect(Socket.java:842)
at libcore.net.http.HttpConnection.<init>(HttpConnection.java:76)
at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)
at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316)
at libcore.net.http.HttpEngine.connect(HttpEngine.java:311)
at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)
at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)
at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81)
at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197)
at retrofit.client.UrlConnectionClient.prepareRequest(UrlConnectionClient.java:68)
at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:37)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:321)
at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at retrofit.Platform$Android$2$1.run(Platform.java:142)
at java.lang.Thread.run(Thread.java:841)
Caused by: libcore.io.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
at libcore.io.IoBridge.isConnected(IoBridge.java:208)
at libcore.io.IoBridge.connectErrno(IoBridge.java:161)
at libcore.io.IoBridge.connect(IoBridge.java:112)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
at java.net.Socket.connect(Socket.java:842)
at libcore.net.http.HttpConnection.<init>(HttpConnection.java:76)
at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)
at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:316)
at libcore.net.http.HttpEngine.connect(HttpEngine.java:311)
at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:290)
at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:240)
at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:81)
at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197)
at retrofit.client.UrlConnectionClient.prepareRequest(UrlConnectionClient.java:68)
at retrofit.client.UrlConnectionClient.execute(UrlConnectionClient.java:37)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:321)
at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at retrofit.Platform$Android$2$1.run(Platform.java:142)
at java.lang.Thread.run(Thread.java:841)
07-13 15:57:54.857 820-840/it.test.android.app.activity D/Retrofit﹕ ---- END ERROR
在您的电话上,连接到localhost:3000
意味着“连接到本地网络接口上的端口3000”--这是电话的本地接口,而不是您的电话所连接的PC的端口3000。在电话端口3000上没有任何监听,因此您会收到连接拒绝错误。
你想要做的是(如果没有更多的信息,很难猜测)从电话连接到PC上的3000端口。因此,您应该将要连接的地址从localhost
更改为PC的地址。如果是模拟器,则为10.0.2.2(它是PC的本地主机)。请参阅网络信息以供参考。
PostgreSQL出现错误: 和文件是正常的(参见下面)。 服务器正在运行 我的文件:
问题内容: 我在Windows 7上使用 mysql-installer-5.5.20.0.msi 安装了MySQL 。在cmd窗口中,运行“ mysqlshow -u root -p”。它要求输入密码,然后返回此错误:“无法连接到’localhost’上的MySQL服务器(10061)”。这是部分失败/成功安装的错误指示。 阅读页面http://dev.mysql.com/doc/refman/
我正在使用mac,版本10.14.6,Appium v 1.15和Java8。 我启动Appium作为应用程序,然后试图启动我的自动测试,但有一个失败时,Java试图创建Android驱动程序实例 查看具有功能的屏幕截图 堆栈跟踪 我想这可能是由于Mac的安全策略,因为在Windows上一切都正常。我应该如何解决该问题?
问题内容: 我最近在Windows 2003上安装了MySQL 5,并尝试配置实例。一切正常,直到我进入“应用安全设置”,这时才出现上述错误()。 我的防火墙中确实存在“ MySQL Server”的端口3306异常。 问题答案: 您可能必须向用户授予表上的“ localhost”特权。请参阅语法文档。这是一个示例(来自C语言)。 “在%s上授予所有特权。*由’%s’标识为’%s’@’本地主机’”
我在EC2上有两个服务器。一个托管我的php应用程序,另一个托管我的redis服务器。我在redis服务器上管理我的php会话和数据。因此,在我的php服务器上,我将ip:port作为会话保存路径,并在stderr中收到了错误FastCGI:“php消息:php致命错误:未捕获异常‘redisception’,消息‘Connection closed’” 我需要在我的redis实例上为入站流量打开
问题内容: 我有MySQL的Laravel应用程序,我正在尝试使用docker-compose在Docker中运行它。但是,当应用尝试连接数据库时,它会抛出: Connector.php 55行中的PDOException:SQLSTATE [HY000] [2002]无法通过套接字’/var/run/mysqld/mysqld.sock’连接到本地MySQL服务器(2) 我的docker-com