为什么jsp:include(有时)在Google App Engine上导致StackOverflowErrors? [英] Why does jsp:include (sometimes) cause StackOverflowErrors on Google App Engine?

查看:196
本文介绍了为什么jsp:include(有时)在Google App Engine上导致StackOverflowErrors?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了 StackOverflowErrors ,其中包含对GAE上最新版本应用程序的所有请求。我追踪了问题#3588 ,但因为记者被关闭了把它归咎于第三方库,谷歌工程师不想再看。在我的情况下,没有第三方库可以负责。我只是在我的页面模板中做了一些非常基本的jsp:include。



记录的错误是这样开始的:

  java.lang.StackOverflowError $ b $在java.util.HashMap.removeEntryForKey(HashMap.java:565)
在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.Dispatc她的$ IncludeAttributes.setAttribute(Dispatcher.java:549)
at org.mortbay.jetty.servlet.Dispatcher $ IncludeAttributes.removeAttribute(Dispatcher.java:569)

Get / setAttribute调用重复一段时间,然后...

  at com.google.apphosting.runtime.jetty.ResourceFileServlet.serveWelcomeFileAsForward(ResourceFileServlet.java:340)
在com.google.apphosting.runtime.jetty.ResourceFileServlet.maybeServeWelcomeFile(ResourceFileServlet.java:281)
的com.google.apphosting.runtime.jetty.ResourceFileServlet.doGet(ResourceFileServlet.java:142)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:617)$ b $在javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
在org.mortbay.jetty。 servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.sec urity.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler。处理(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:包括某种方式。我以前版本的应用程序工作并使用jsp:include,但这个较新的版本也使用jsp:param和一些EL语法。这些可能与问题有关,或者可能不相关。这一切都在开发中起作用。该问题仅在部署到GAE后才会显示,此时所有页面请求都会导致500个服务器错误,并且日志显示此StackOverflowError。没有任何记录的堆栈跟踪在任何地方提及我的任何代码。



堆栈跟踪还提到maybeServeWelcomeFile和serveWelcomeFileAsForward。这个最新版本的web.xml中的welcome-file定义没有任何变化。

我的下一步将尝试隔离造成这种情况的确切变化,但其他人可以提供的任何洞察力都会非常有用。

解决方案

这个错误是由jsp引起的:包括服务器上不存在的文件。请参阅问题#5564 。不知何故,当我部署到Google App Engine时,我的开发环境中存在的某些文件无法上传(更新:,另请参阅 issue#5565 )。


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.

解决方案

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).

这篇关于为什么jsp:include(有时)在Google App Engine上导致StackOverflowErrors?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆