不知道是新迁移了服务器问题还是什么问题,总之就是在执行oauth.getAccessTokenByCode(code);这行代码报错,一下是报错信息,求大神帮助:
weibo4j.model.WeiboException: cloud-9892: cloud-9892: unknown error
at weibo4j.http.HttpClient.httpRequest(HttpClient.java:423)
at weibo4j.http.HttpClient.post(HttpClient.java:303)
at weibo4j.Oauth.getAccessTokenByCode(Oauth.java:76)
at com.action.LoginAction.loginByWeiBo(LoginAction.java:190)
at sun.reflect.GeneratedMethodAccessor1753.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
其余省略。。。。。
Caused by: java.net.UnknownHostException: cloud-9892: cloud-9892: unknown error
at java.net.InetAddress.getLocalHost(InetAddress.java:1484)
at weibo4j.http.HttpClient.httpRequest(HttpClient.java:380)
... 83 more
Caused by: java.net.UnknownHostException: cloud-9892: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302)
at java.net.InetAddress.getLocalHost(InetAddress.java:1479)
... 84 more
------解决思路----------------------
都沉到第二页了 帮顶下
------解决思路----------------------
我是做类似api开发的,你可以用restclient直接访问新浪api,这是简单用法http://blog.csdn.net/liweifeng8907/article/details/8820731,根据返回结果判断原因
------解决思路----------------------
UnknownHostException,IP不对,你是调用新浪api吧?这个有网就可以访问的
------解决思路----------------------
那应该是网络问题,你可以看看这个http://bbs.csdn.net/topics/390645403?page=1