我正在将使用 Jawr 的 Hybris 应用程序部署到 Tomcat 服务器。在启动时,JawrServlet 会引发 StackOverflow 错误。
这个错误很难重现,但在处理 CSSServlet 的过程中总是会发生。记录后不久:
[JawrRequestHandler] Initializing jawr config for request handler named CSSServlet
这就是在我的 web.xml 中配置 Servlet 的方式:
<servlet>
<servlet-name>CSSServlet</servlet-name>
<servlet-class>net.jawr.web.servlet.JawrServlet</servlet-class>
<!-- Location in classpath of the config file -->
<init-param>
<param-name>configLocation</param-name>
<param-value>/jawrsetup.properties</param-value>
<!--<param-value>/jawrTEST.properties</param-value>-->
</init-param>
<init-param>
<param-name>type</param-name>
<param-value>css</param-value>
</init-param>
<init-param>
<param-name>mapping</param-name>
<param-value>/jawr-css</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
这是发生错误的控制台日志的一部分:
INFO | jvm 1 | main | 2013/01/29 11:20:16.081 | 11:20:16,036 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/pause.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.082 | 11:20:16,036 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/pause-ie.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.082 | 11:20:16,036 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/left-hover.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.087 | 11:20:16,036 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/left-hover-ie.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.087 | 11:20:16,036 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/right-hover.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.087 | 11:20:16,045 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/right-hover-ie.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.092 | 11:20:16,045 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/play-hover.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.092 | 11:20:16,045 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/play-hover-ie.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.092 | 11:20:16,045 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/pause-hover.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.093 | 11:20:16,045 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bk-ruby/pause-hover-ie.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.097 | 11:20:16,045 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url('/images/bg.png')
INFO | jvm 1 | main | 2013/01/29 11:20:16.098 | 11:20:16,046 [WrapperSimpleAppMain] DEBUG [Base64PostProcessorCssImageUrlRewriter] Skip encoding image resource : url("/images/content-bg.png")
INFO | jvm 1 | main | 2013/01/29 11:20:16.098 | 11:20:16,057 [WrapperSimpleAppMain] INFO [Base64ImageEncoderPostProcessor] Base64 Postprocessing done
INFO | jvm 1 | main | 2013/01/29 11:20:16.098 | 11:20:16,058 [WrapperSimpleAppMain] DEBUG [AbstractChainedResourceBundlePostProcessor] postprocessing bundle:/bundles/dmlights.css
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | Jan 29, 2013 11:20:16 AM org.apache.catalina.core.ApplicationContext log
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | SEVERE: StandardWrapper.Throwable
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | java.lang.StackOverflowError
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$LazyLoop.match(Unknown Source)
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$GroupTail.match(Unknown Source)
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$CharProperty.match(Unknown Source)
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$Ques.match(Unknown Source)
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$GroupHead.match(Unknown Source)
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$LazyLoop.match(Unknown Source)
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$GroupTail.match(Unknown Source)
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$CharProperty.match(Unknown Source)
INFO | jvm 1 | main | 2013/01/29 11:20:16.198 | at java.util.regex.Pattern$Ques.match(Unknown Source)