Java servlet Tomcat随机stackoverflower

时间:2017-03-28 07:27:25

标签: java windows tomcat servlets stack-overflow

我这里有一个非常奇怪的问题。

当我在我的网络应用中执行特定操作时,我会随机StackOverFlowError。请参阅下面的日志文件。

我正在使用Win10 64bitTomcat 8.5.12 64bitJava 1.8.0.121

我已经有了StackOverFlowError

  • javax.servlet.ServletRequestWrapper.getCookies()
  • javax.servlet.ServletRequestWrapper.getCharacterEncoding()
  • org.apache.catalina.core.ApplicationHttpRequest.getAttribute()
  • org.apache.catalina.core.ApplicationHttpRequest.setAttribute()
  • javax.servlet.ServletRequestWrapper.isAsyncStarted()
  • org.apache.catalina.core.ApplicationHttpRequest.getSession()
  • ...

我只有在特定的上下文路径上部署我的webapp时才会遇到此问题(例如:http://localhost:8080/mywebapp),如果我部署在根(http://localhost:8080/)上,我就不会这样做。有这个问题。

我的应用程序的旧版本出现此问题,旧版本之前运行良好,因此解决方案不在我认为的应用程序代码中。

我已经测试过了:

  • 使用旧版本或最后一个Tomcat版本
  • 使用Tomcat 32或64位版本
  • 使用较旧或最后一个Java版本
  • 使用Java 32或64位
  • 使用多个网络浏览器
  • 我的应用程序的旧版本(之前运作良好)
  • 在另一台PC上

什么都行不通......

我认为这是由转发请求引起的。 有人可以帮我解决这个问题吗?

TIA,

27-Mar-2017 14:38:45.374 SEVERE [http-nio-8080-exec-1] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet AliasServlet threw exception
 java.lang.StackOverflowError
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    (...)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:246)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:359)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    (...)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)

27-Mar-2017 14:38:45.379 SEVERE [http-nio-8080-exec-1] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet AliasServlet threw exception
 java.lang.StackOverflowError
    at javax.servlet.ServletRequestWrapper.isAsyncStarted(ServletRequestWrapper.java:409)
    at javax.servlet.ServletRequestWrapper.isAsyncStarted(ServletRequestWrapper.java:409)
    at javax.servlet.ServletRequestWrapper.isAsyncStarted(ServletRequestWrapper.java:409)
    (...)
    at javax.servlet.ServletRequestWrapper.isAsyncStarted(ServletRequestWrapper.java:409)
    at javax.servlet.ServletRequestWrapper.isAsyncStarted(ServletRequestWrapper.java:409)
    at javax.servlet.ServletRequestWrapper.isAsyncStarted(ServletRequestWrapper.java:409)
    at org.apache.catalina.core.ApplicationDispatcher.unwrapRequest(ApplicationDispatcher.java:813)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:789)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    (...)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    at be.mims.ali.web.servlet.AliasServlet.dynPage(AliasServlet.java:254)
    at be.mims.ali.web.servlet.AliasServlet.processRequest(AliasServlet.java:55)
    at be.mims.ali.web.servlet.AliasServlet.doPost(AliasServlet.java:436)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

0 个答案:

没有答案