启动DrEdit会产生500个服务器错误 - 应用程序日志显示"无法处理OAuth2回调"

时间:2015-03-08 07:56:34

标签: google-app-engine google-oauth-java-client google-oauth2

我是Google Drive API的新手,最近使用驱动API完成了两个小项目。我现在正在实施DrEdit并遵循以下提到的说明 - https://github.com/googledrive/dredit/blob/master/java/README.md 在Eclipse中成功部署之后,当应用程序启动时,我会看到同意屏幕,在接受之后,我收到以下错误: 错误:服务器错误 服务器遇到错误,无法完成您的请求。 请在30秒后再试一次。

以下是google app引擎的日志跟踪。

Uncaught exception from servlet
java.lang.RuntimeException: Can't handle the OAuth2 callback, make sure that code is valid.
    at edu.csus.dredit.DrEditServlet.handleCallbackIfRequired(DrEditServlet.java:178)
    at edu.csus.dredit.StartPageServlet.doGet(StartPageServlet.java:43)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
    at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
    at com.google.apphosting.runtime.jetty.ResourceFileServlet.serveWelcomeFileAsForward(ResourceFileServlet.java:342)
    at com.google.apphosting.runtime.jetty.ResourceFileServlet.maybeServeWelcomeFile(ResourceFileServlet.java:281)
    at com.google.apphosting.runtime.jetty.ResourceFileServlet.doGet(ResourceFileServlet.java:142)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:254)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:527)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
    at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
    at java.lang.Thread.run(Thread.java:724)

我在这里看到很多帖子但没有成功。我不确定,出了什么问题。我阅读本文档以启用OAuth2的无密码登录:https://cloud.google.com/appengine/docs/java/tools/uploadinganapp 在这里 -

C:\Program Files (x86)\eclipse luna 4.4\eclipse\plugins\com.google.appengine.ecl
ipse.sdkbundle_1.9.18\appengine-java-sdk-1.9.18\bin>appcfg --oauth2 update C:\Us
ers\Pilluda\git\dredit\war
Mar 07, 2015 5:39:19 PM com.google.appengine.repackaged.com.google.api.client.ex
tensions.java6.auth.oauth2.FileCredentialStore <init>
WARNING: unable to change file permissions for everybody: C:\Users\Pilluda\.appc
fg_oauth2_tokens_java
Please enter code: 4/5Wft2ANn7R7RiheUSOuCM_gQ_wsl6fiwRU6Ie7sICKQ.wvQzIOeFCgAdEnp
6UAPFm0F0jRXulwI
Reading application configuration data...
Mar 07, 2015 5:40:59 PM com.google.apphosting.utils.config.AppEngineWebXmlReader
 readAppEngineWebXml
INFO: Successfully processed C:/Users/Pilluda/git/dredit/war\WEB-INF/appengine-w
eb.xml
Mar 07, 2015 5:40:59 PM com.google.apphosting.utils.config.AbstractConfigXmlRead
er readConfigXml
INFO: Successfully processed C:/Users/Pilluda/git/dredit/war\WEB-INF/web.xml


Beginning interaction for module default...
0% Created staging directory at: 'C:\Users\Pilluda\AppData\Local\Temp\appcfg2174
618651168391922.tmp'
5% Scanning for jsp files.
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 2 static files.
31% Cloning 59 application files.
40% Uploading 0 files.
52% Initializing precompilation...
90% Deploying new version.
95% Closing update: new version is ready to start serving.
98% Uploading index definitions.

Update for module default completed successfully.
Success.
Cleaning up temporary files for module default...

如果有人知道如何解决这个问题,请告诉我。

1 个答案:

答案 0 :(得分:0)

通过Eclipse创建Project Facets并将其作为Web项目授予权限并构建清理和部署。 现在我没有看到这个错误。好消息是,OAUTH2完成的身份验证成功完成,令牌被发送和刷新,数据可见。