Azure通知中心java.net.ConnectException:连接超时:无更多信息

时间:2017-07-25 16:33:37

标签: java nio azure-notificationhub connectexception

我正在尝试通过Java使用Azure通知中心。在尝试创建注册时,我得到一个java.net.ConnectException:连接超时:没有进一步的信息。有人可以帮助我理解为什么会出现这个问题吗?如果您需要更多信息,请告诉我。感谢。

使用https://github.com/Azure/azure-notificationhubs-java-backend/blob/master/NotificationHubs中的代码。

Jar文件版本如下:

httpclient - 4.3.1
httpcore - 4.3.1
httpcore-nio - 4.3.1

SyncCallback类中出现错误,方法 - “失败”。异常跟踪如下。

java.lang.RuntimeException: java.net.ConnectException: Connection timed out: no further information
    at com.org.utils.notifications.SyncCallback.failed(SyncCallback.java:41)
    at org.apache.http.concurrent.BasicFuture.failed(BasicFuture.java:130)
    at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.connectionRequestFailed(DefaultClientExchangeHandlerImpl.java:318)
    at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.access$100(DefaultClientExchangeHandlerImpl.java:63)
    at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl$1.failed(DefaultClientExchangeHandlerImpl.java:364)
    at org.apache.http.concurrent.BasicFuture.failed(BasicFuture.java:130)
    at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager$InternalPoolEntryCallback.failed(PoolingNHttpClientConnectionManager.java:474)
    at org.apache.http.concurrent.BasicFuture.failed(BasicFuture.java:130)
    at org.apache.http.nio.pool.RouteSpecificPool.failed(RouteSpecificPool.java:165)
    at org.apache.http.nio.pool.AbstractNIOConnPool.requestFailed(AbstractNIOConnPool.java:530)
    at org.apache.http.nio.pool.AbstractNIOConnPool$InternalSessionRequestCallback.failed(AbstractNIOConnPool.java:778)
    at org.apache.http.impl.nio.reactor.SessionRequestImpl.failed(SessionRequestImpl.java:154)
    at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:175)
    at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:147)
    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:349)
    at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:189)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.doExecute(CloseableHttpAsyncClientBase.java:67)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.access$000(CloseableHttpAsyncClientBase.java:38)
    at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:57)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection timed out: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173)
    ... 7 more

1 个答案:

答案 0 :(得分:1)

你可以找到这个java.net.ConnectException: Connection timed out异常的一些内容。

  1. 系统端口的防火墙已用于项目中。 检查你的文件设置并取消阻止端口。

  2. IP /域或端口不正确。 尝试pingtelnet命令来检查连接性。

  3. 可能是由于网速较慢或havy进程服务器未在时间段内处理请求,或者可能是b连接问题。