为什么 jsp:include (有时)会在 Google App Engine 上导致 StackOverflowErrors?
我在 GAE 上对最新版本应用程序的所有请求中都遇到了 StackOverflowErrors
。我找到了问题 #3588,但该问题已关闭,因为报告者将其归咎于第三方库,而 Google 工程师不想再进一步查找。就我而言,没有第三方库可以指责。我只是在我的页面模板中做了一些非常基本的 jsp:includes 。
记录的错误如下所示:
java.lang.StackOverflowError
at java.util.HashMap.removeEntryForKey(HashMap.java:565)
at java.util.HashMap.remove(HashMap.java:555)
at org.mortbay.util.AttributesMap.removeAttribute(AttributesMap.java:51)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:441)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.removeAttribute(Dispatcher.java:461)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.setAttribute(Dispatcher.java:549)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.removeAttribute(Dispatcher.java:569)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.setAttribute(Dispatcher.java:549)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.removeAttribute(Dispatcher.java:569)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.setAttribute(Dispatcher.java:549)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.removeAttribute(Dispatcher.java:569)
Get/setAttribute 调用重复一段时间,然后...
at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:145)
at com.google.apphosting.runtime.jetty.ResourceFileServlet.serveWelcomeFileAsForward(ResourceFileServlet.java:340)
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.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.include(Dispatcher.java:192)
at
并且该块也会重复。
第 3588 期的记者和我都认为这与 jsp:include 存在某种关系。我的应用程序的先前版本可以正常工作并使用 jsp:include,但这个较新的版本还使用 jsp:param 和一些 EL 语法。这些可能与问题有关,也可能无关。这一切都在开发中进行。该问题仅在部署到 GAE 后才会出现,此时所有页面请求都会导致 500 服务器错误,并且日志显示此 StackOverflowError。记录的堆栈跟踪都没有提到我的任何代码。
堆栈跟踪还提到了 MaybeServeWelcomeFile 和serveWelcomeFileAsForward。在这个最新版本中,web.xml 中的欢迎文件定义没有任何变化。
谷歌搜索发现了上面链接的问题,但没有发现其他问题。我的下一步将尝试找出导致此问题的确切更改,但其他人可以提供的任何见解都会非常有帮助。
I am experiencing StackOverflowErrors
with all requests to the latest version of an application on GAE. I tracked down Issue #3588 but that was closed because the reporter blamed it on a third-party library and the Google engineer didn't want to look any further. In my case, there is no third-party library to blame. I'm just doing some very basic jsp:includes in my page template.
The logged error starts like this:
java.lang.StackOverflowError
at java.util.HashMap.removeEntryForKey(HashMap.java:565)
at java.util.HashMap.remove(HashMap.java:555)
at org.mortbay.util.AttributesMap.removeAttribute(AttributesMap.java:51)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:441)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.removeAttribute(Dispatcher.java:461)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.setAttribute(Dispatcher.java:549)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.removeAttribute(Dispatcher.java:569)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.setAttribute(Dispatcher.java:549)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.removeAttribute(Dispatcher.java:569)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.setAttribute(Dispatcher.java:549)
at org.mortbay.jetty.servlet.Dispatcher$IncludeAttributes.removeAttribute(Dispatcher.java:569)
Get/setAttribute calls repeat for a while, then...
at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:145)
at com.google.apphosting.runtime.jetty.ResourceFileServlet.serveWelcomeFileAsForward(ResourceFileServlet.java:340)
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.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.include(Dispatcher.java:192)
at
And that block repeats also.
Both the reporter of issue 3588 and I believe this relates to jsp:include somehow. The previous version of my application worked and used jsp:include, but this newer version also uses jsp:param and some EL syntax. Those might be related to the problem, or they might not. This all works in development. The problem only manifests after deploying to GAE, at which point all page requests result in 500 server errors and the logs show this StackOverflowError. None of the logged stack traces mention any of my code anywhere.
The stack trace also mentions maybeServeWelcomeFile and serveWelcomeFileAsForward. Nothing changed in my welcome-file definitions in web.xml with this latest version.
Google Search turned up the issue linked above, but nothing else. My next steps will be trying to isolate the exact change that caused this, but any insight others can provide would be very helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此错误是由 jsp:include a file that does not exist on the server 引起的。请参阅问题 #5564。不知何故,当我部署到 Google App Engine 时,我的开发环境中存在的某些文件没有上传(更新:另请参阅问题 #5565)。
This error is caused by jsp:including a file that doesn't exist on the server. See issue #5564. Somehow certain files that exist in my development environment aren't getting uploaded when I deploy to Google App Engine (Update: see also issue #5565).