JAVA项目可以正常推送,WEB报超时异常

jpush
标签: #<Tag:0x00007fb83b1a3060>

(chentianyi55) #1

我在git上面下载了官网的SDK项目测试了下是可以正常推送的,但我转成maven WEB项目之后不知道为什么总是报超时异常,请帮忙看下这是日志

17/09/15 09:45:02 INFO connection.NativeHttpClient: Created instance with connectionTimeout 5,000, readTimeout 30,000, maxRetryTimes 3, SSL Version TLS
17/09/15 09:45:02 INFO connection.NativeHttpClient: Created instance with connectionTimeout 5,000, readTimeout 30,000, maxRetryTimes 3, SSL Version TLS
17/09/15 09:45:02 INFO connection.NativeHttpClient: Created instance with connectionTimeout 5,000, readTimeout 30,000, maxRetryTimes 3, SSL Version TLS
17/09/15 09:45:02 INFO connection.NativeHttpClient: Created instance with connectionTimeout 5,000, readTimeout 30,000, maxRetryTimes 3, SSL Version TLS
17/09/15 09:45:02 DEBUG connection.NativeHttpClient: Send request - GET https://api.jpush.cn/v3/push/cid?count=3&type=push
17/09/15 09:45:07 DEBUG connection.NativeHttpClient: connect timed out - retry again - 1
17/09/15 09:45:07 DEBUG connection.NativeHttpClient: Send request - GET https://api.jpush.cn/v3/push/cid?count=3&type=push
17/09/15 09:45:12 DEBUG connection.NativeHttpClient: connect timed out - retry again - 2
17/09/15 09:45:12 DEBUG connection.NativeHttpClient: Send request - GET https://api.jpush.cn/v3/push/cid?count=3&type=push
17/09/15 09:45:17 DEBUG connection.NativeHttpClient: connect timed out - retry again - 3
17/09/15 09:45:17 DEBUG connection.NativeHttpClient: Send request - GET https://api.jpush.cn/v3/push/cid?count=3&type=push
17/09/15 09:45:22 ERROR examples.PushExample: Connection error. Should retry later. 
cn.jiguang.common.resp.APIConnectionException: connect timed out. 
Connect to JPush Server timed out, and already retried some times. 
Please ensure your internet connection is ok. 
If the problem persists, please let us know at support@jpush.cn.
	at cn.jiguang.common.connection.NativeHttpClient.doRequest(NativeHttpClient.java:107)
	at cn.jiguang.common.connection.NativeHttpClient.sendGet(NativeHttpClient.java:71)
	at cn.jiguang.common.connection.NativeHttpClient.sendGet(NativeHttpClient.java:66)
	at cn.jpush.api.push.PushClient.getCidList(PushClient.java:227)
	at cn.jpush.api.JPushClient.getCidList(JPushClient.java:237)
	at cn.jpush.api.examples.PushExample.testGetCidList(PushExample.java:426)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.net.SocketTimeoutException: connect timed out
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:579)
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1300)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
	at cn.jiguang.common.connection.NativeHttpClient._doRequest(NativeHttpClient.java:166)
	at cn.jiguang.common.connection.NativeHttpClient.doRequest(NativeHttpClient.java:99)
	... 28 more

#2

检查一下你的网络配置。


(chentianyi55) #3

但是我用官网上的JAVA项目是可以正常推送的,转成WEB才报这个错


(KenChoi) #4

你 web 端有没有配置什么代理端口之类的,参考上面的常见问题。