调用OAuth4Code 出现WeiboException: Connection reset

0 INFO [2017-07-27 15:38:23] code: 3ea4c7a657c4e1f8e092441e8aafe23f
3 DEBUG [2017-07-27 15:38:23] Request:
3 DEBUG [2017-07-27 15:38:23] POSThttps://api.weibo.com/oauth2/access_token
653 INFO [2017-07-27 15:38:24] I/O exception (java.net.SocketException) caught when processing request: Connection reset
654 INFO [2017-07-27 15:38:24] Retrying request
1042 INFO [2017-07-27 15:38:24] I/O exception (java.net.SocketException) caught when processing request: Connection reset
1043 INFO [2017-07-27 15:38:24] Retrying request
1434 INFO [2017-07-27 15:38:25] I/O exception (java.net.SocketException) caught when processing request: Connection reset
1434 INFO [2017-07-27 15:38:25] Retrying request
weibo4j.model.WeiboException: Connection reset
at weibo4j.http.HttpClient.httpRequest(HttpClient.java:412)
at weibo4j.http.HttpClient.post(HttpClient.java:293)
at weibo4j.Oauth.getAccessTokenByCode(Oauth.java:79)
at weibo4j.examples.oauth2.OAuth4Code.main(OAuth4Code.java:21)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:189)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:312)
at sun.security.ssl.InputRecord.read(InputRecord.java:350)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1328)
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702)
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:506)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at weibo4j.http.HttpClient.httpRequest(HttpClient.java:387)
... 3 more

1个回答

服务器已经关闭了连接,可能是你前面的代码已经关闭了连接,或者连接已经重置了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问