启动 DrEdit 出现 500 服务器错误 - 应用程序日志显示 "Can't handle the OAuth2 callback"
Launching DrEdit gives 500 server error - application logs says "Can't handle the OAuth2 callback"
我是 Google 驱动器 API 的新手,最近使用驱动器 API 完成了两个小项目。我现在正在实施 DrEdit 并遵循了 -
https://github.com/googledrive/dredit/blob/master/java/README.md
在 Eclipse 中成功部署后,当应用程序启动时,我看到同意屏幕,接受后,出现以下错误:
错误:服务器错误
服务器遇到错误,无法完成您的请求。
请在 30 秒后重试。
这是 google 应用引擎的日志跟踪。
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.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...
如果有人知道如何解决这个问题,请告诉我。
通过 Eclipse 创建 Project Facets,并作为 Web 项目授予权限,构建干净并部署。
现在我没有看到这个错误。好消息是,OAUTH2 完成的身份验证已成功完成,令牌已发送并刷新,数据可见。
我是 Google 驱动器 API 的新手,最近使用驱动器 API 完成了两个小项目。我现在正在实施 DrEdit 并遵循了 - https://github.com/googledrive/dredit/blob/master/java/README.md 在 Eclipse 中成功部署后,当应用程序启动时,我看到同意屏幕,接受后,出现以下错误: 错误:服务器错误 服务器遇到错误,无法完成您的请求。 请在 30 秒后重试。
这是 google 应用引擎的日志跟踪。
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.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...
如果有人知道如何解决这个问题,请告诉我。
通过 Eclipse 创建 Project Facets,并作为 Web 项目授予权限,构建干净并部署。 现在我没有看到这个错误。好消息是,OAUTH2 完成的身份验证已成功完成,令牌已发送并刷新,数据可见。