Friday, February 14, 2014
java appear unknownHostException with Sina Weibo api? ? ?
Recent studies using the Sina microblogging java version APi, all kinds of things are good applications, token also test platform Sina Weibo above test, no problem, but Sina's own JAVA SDK to send in examples of micro-Bo (myeclipse) on error: (when authorized certification, and often appeared so many times you want to refresh, and only then code to get, then get a long time to get the token, are reported this error!), seeking the guidance of the great God!
weibo4j.model.WeiboException: api.weibo.com
at weibo4j.http.HttpClient.httpRequest (HttpClient.java: 422)
at weibo4j.http.HttpClient.post (HttpClient.java: 302)
at weibo4j.Oauth.getAccessTokenByCode (Oauth.java: 90)
at weibo4j.examples.oauth2.OAuth4Code.main (OAuth4Code.java: 21)
Caused by: java.net.UnknownHostException: api.weibo.com
at java.net.AbstractPlainSocketImpl.connect (Unknown Source)
at java.net.PlainSocketImpl.connect (Unknown Source)
at java.net.SocksSocketImpl.connect (Unknown Source)
at java.net.Socket.connect (Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect (Unknown Source)
at weibo4j.model.MySSLSocketFactory.createSocket (MySSLSocketFactory.java: 88)
at org.apache.commons.httpclient.HttpConnection.open (HttpConnection.java: 707)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager $ HttpConnectionAdapter.open (MultiThreadedHttpConnectionManager.java: 1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry (HttpMethodDirector.java: 387)
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: 396)
... 3 more<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Host address is unknown, you can look my DEMO
Reply:
http://download.csdn.net/detail/mmorss/5066014
Reply:
Ah sorry, I made the wrong forum, and I am doing is java web version, not the Android! But it Thank You! Do you have knowledge of the web version of Twitter api problem?
Reply:
Ah sorry, I made the wrong forum, and I am doing is java web version, not the Android! But it Thank You! Do you have knowledge of the web version of Twitter api problem?
Reply:
Sorry ah, I have not done in that regard, render you
Reply:
Problem has been resolved, a DNS problem, my network is automatically obtain DNS server, I put him into Google's: 8.8.8.8 8.8.4.4, you can! Thank you for your help!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment