正嘗試通過Java使用Azure通知中心。當試圖創建註冊時,我得到一個java.net.ConnectException:連接超時:沒有進一步的信息。有人能幫我理解爲什麼會出現這個問題嗎?請讓我知道你是否需要更多信息。謝謝。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
您可以檢查調試器在哪裏試圖連接並確保您可以通過命令行或任何其他方式進行調用?它可能是封閉的端口或防火牆阻止呼叫。 –