当前位置: 代码迷 >> Java Web开发 >> 新浪微博oauth2.0授权有关问题,请各位同学帮忙看看,多谢
  详细解决方案

新浪微博oauth2.0授权有关问题,请各位同学帮忙看看,多谢

热度:4878   发布时间:2013-02-25 21:09:48.0
新浪微博oauth2.0授权问题,请各位同学帮忙看看,谢谢!
从前台可以传入code后,利用新浪JAVA API oauth类不能得到accessToken。错误信息在下面,请各位同学帮忙看看,谢谢!
在本地测试,是可以的,但是上传SAE服务器就不行了,请各位同学帮忙看看,谢谢!


------------------------getinfo.jsp Code---------------------------
<% out.println("begin............."); 
String code = request.getParameter("code"); 
out.println("code............." + code); 
//调用API获取accessonToken
AccessToken accessToken = oauth.getAccessTokenByCode(code); 

out.println("accessToken..." + accessToken.getAccessToken()); 
out.println(".............end"); %>

----------------------Error info---------------------------
HTTP ERROR 500

Problem accessing /getinfo.jsp. Reason:

Resource temporarily unavailable
Caused by:

weibo4j.model.WeiboException: Resource temporarily unavailable
at weibo4j.http.HttpClient.httpRequest(HttpClient.java:422)
at weibo4j.http.HttpClient.post(HttpClient.java:302)
at weibo4j.Oauth.getAccessTokenByCode(Oauth.java:80)
at org.apache.jsp.getinfojsp.jspService(org.apache.jsp.getinfo_jsp:113)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.sina.sae.jasper.servlet.SaeJspServletWrapper.service(SaeJspServletWrapper.java:225)
at com.sina.sae.jasper.servlet.SaeJspServlet.serviceJspFile(SaeJspServlet.java:238)
at com.sina.sae.jasper.servlet.SaeJspServlet.service(SaeJspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)
at com.sina.sae.servlet.SaeServletHandler.doHandle(SaeServletHandler.java:49)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:937)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:871)
at com.sina.sae.webapp.SaeWebAppContext.doScope(SaeWebAppContext.java:164)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:259)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at com.sina.sae.handler.SaeUserInfoHandler.handle(SaeUserInfoHandler.java:105)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:305)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:346)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1048)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:601)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
at java.lang.Thread.run(Thread.java:714)

------解决方案--------------------------------------------------------
  相关解决方案