GAE/J 上的 jsp 出现错误 500

发布于 2024-11-01 10:56:16 字数 7917 浏览 0 评论 0原文

我的 App Engine 上的 JSP 出现奇怪的错误 500。

这很奇怪,因为错误发生在jsp的第3个请求中。

所以我浏览到 .jsp url,重新加载 2-3 次,有 2-3 个错误 500,我再次点击重新加载,它起作用了。

test.jsp 看起来像这样:

<% String s = "hello"; %><h2><% out.println(s); %></h2>

有趣的是我的 html 文件可以工作,js 发出的异步请求也可以工作。

我想我在配置中的某个地方犯了错误,但我找不到。

编辑:

我尝试清空 web.xml、queue.xml 并重置 appengine-web.xml

错误日志位于 Pastebin 上:pastebin.com/TDZH4xj3

I还禁用了始终打开选项,并以新名称重新部署了该应用程序。还是同样的错误。

2011-04-18 00:10:20.312 /test.jsp 500 3665ms 1820cpu_ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.29 (KHTML, like Gecko) Chrome/12.0.733.0 Safari/534.29,gzip(gfe),gzip(gfe),gzip(gfe)
92.245.143.214 - - [18/Apr/2011:00:10:20 -0700] "GET /test.jsp HTTP/1.1" 500 0 - "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.29 (KHTML, like Gecko) Chrome/12.0.733.0 Safari/534.29,gzip(gfe),gzip(gfe),gzip(gfe)" "www.planeteimmo.net" ms=3666 cpu_ms=1820 api_cpu_ms=0 cpm_usd=0.050630 loading_request=1



W 2011-04-18 00:10:20.297
Error for /test.jsp
java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
    at org.apache.jsp.test_jsp._jspInit(test_jsp.java:22)
    at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:76)
    at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
    at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
    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.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:238)
    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:135)
    at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
    at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9285)
    at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
    at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)





C 2011-04-18 00:10:20.307
Uncaught exception from servlet
java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
    at org.apache.jsp.test_jsp._jspInit(test_jsp.java:22)
    at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:76)
    at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
    at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
    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.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:238)
    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:135)
    at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
    at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9285)
    at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
    at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)

I have a weird error 500 with my JSPs on App Engine.

It's weird because the error happens only with the 3 firsts requests of the jsp.

So I browse to the .jsp url, I reload 2-3 times, I have 2-3 errors 500, I hit reload again, it works.

The test.jsp looks like this:

<% String s = "hello"; %><h2><% out.println(s); %></h2>

The fun thing is that my html files works, the async requests made by js are working too.

I guess I have an made a mistake somewher in the config, but I can't find out.

edit:

I tried to empty the web.xml, the queue.xml and reset appengine-web.xml

The error log is here on Pastebin: pastebin.com/TDZH4xj3

I also disabled the always on option, and redeployed the app under a new name. Still the same error.

2011-04-18 00:10:20.312 /test.jsp 500 3665ms 1820cpu_ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.29 (KHTML, like Gecko) Chrome/12.0.733.0 Safari/534.29,gzip(gfe),gzip(gfe),gzip(gfe)
92.245.143.214 - - [18/Apr/2011:00:10:20 -0700] "GET /test.jsp HTTP/1.1" 500 0 - "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.29 (KHTML, like Gecko) Chrome/12.0.733.0 Safari/534.29,gzip(gfe),gzip(gfe),gzip(gfe)" "www.planeteimmo.net" ms=3666 cpu_ms=1820 api_cpu_ms=0 cpm_usd=0.050630 loading_request=1



W 2011-04-18 00:10:20.297
Error for /test.jsp
java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
    at org.apache.jsp.test_jsp._jspInit(test_jsp.java:22)
    at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:76)
    at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
    at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
    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.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:238)
    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:135)
    at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
    at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9285)
    at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
    at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)





C 2011-04-18 00:10:20.307
Uncaught exception from servlet
java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
    at org.apache.jsp.test_jsp._jspInit(test_jsp.java:22)
    at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:76)
    at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
    at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
    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.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:238)
    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:135)
    at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
    at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9285)
    at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:437)
    at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小瓶盖 2024-11-08 10:56:16

java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;

您的 web 应用程序的 /WEB-INF/lib 文件夹中有 servletcontainer 特定的库,该库与运行 web 应用程序的 servletcontainer 提供的库冲突。例如,如果您将 jsp-api.jar 从 Apache Tomcat 复制到 web 应用程序的 /WEB-INF/lib 文件夹中,并在某个 servlet 容器上运行该 web 应用程序,就会发生这种情况。完全不同的品牌/版本。在您的特定情况下,其中一个库是旧版本,缺少异常消息中提到的方法。

/WEB-INF/lib 中的它们全部删除。他们绝对不属于那里。它们应该已经由 servlet 容器本身提供。如果您这样做是为了避免编译错误(这是初学者将它们放在错误位置的更常见原因之一),那么需要以不同的方式解决它。

java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;

You have servletcontainer specific libaries in the /WEB-INF/lib folder of your webapp which is conflicting with the libraries provided by the servletcontainer where the webapp runs. This can happen if you copied for example a jsp-api.jar from Apache Tomcat into the webapp's /WEB-INF/lib folder and run the webapp on a servletcontainer of a completely different make/version. In your particular case, one of the libs is of an older version which lacks the in the exception message mentioned method.

Get rid of them all in /WEB-INF/lib. They definitely don't belong there. They ought to be supplied by the servletcontainer itself already. If you did this to circumvent compile errors (which is one of the more common reasons starters put them in the wrong place), then it needs to be solved differently.

つ可否回来 2024-11-08 10:56:16

这也发生在我身上。我的 gwt-dev.jar 位于 /WEB-INF/lib 目录中。它不应该在那里。

This happened to me as well. I had the gwt-dev.jar in the /WEB-INF/lib dir. It should not be there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文