0

我们将 Struts2 用于企业应用程序,但由于 NPE 而崩溃。异常发生在动作的错误处理方法中。我的猜测是,它试图递归地调用错误处理方法,因为当它试图处理错误时,它每次都会得到一个新的 NPE。然后JVM崩溃。

但我的问题是,这可能是崩溃的真正原因吗,递归异常会导致 JVM 崩溃吗?JVM发现自己处于什么类型的情况,这个异常是如何及时影响线程状态的?正如您所看到的,我对 JVM 如何处理线程并没有提供太多信息。感谢您的回复。

祝你今天过得愉快。

编辑:对不起,这是我得到的堆栈跟踪的一部分。Stacktrace 无休止地重复自己。

java.lang.NullPointerException
    at tr.com.innova.tmh.web.isemri.actions.AbonelikIslemleriUtility.jsUrunNumaraDizisiOlustur(AbonelikIslemleriUtility.java:47)
    at tr.com.innova.tmh.web.siparis.actions.SiparisActionSS.errorDispatcher(SiparisActionSS.java:96)
    at sun.reflect.GeneratedMethodAccessor3132.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
    at tr.com.innova.tmh.web.utils.actions.TMHDispatchAction.execute(TMHDispatchAction.java:224)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.tmh.web.ss.filters.WebSecurityFilter.doFilter(WebSecurityFilter.java:62)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.tmh.web.ss.filters.WebLoginFilter.doFilter(WebLoginFilter.java:62)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.tmh.web.surecLog.filter.OHMLoggerFilter.doFilter(OHMLoggerFilter.java:75)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.common.web.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:176)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.tmh.web.utils.filters.XSSFilter.doFilter(XSSFilter.java:16)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:527)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.tmh.web.ss.filters.WebSecurityFilter.doFilter(WebSecurityFilter.java:62)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.tmh.web.ss.filters.WebLoginFilter.doFilter(WebLoginFilter.java:62)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.tmh.web.surecLog.filter.OHMLoggerFilter.doFilter(OHMLoggerFilter.java:75)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.common.web.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:176)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at tr.com.innova.tmh.web.utils.filters.XSSFilter.doFilter(XSSFilter.java:16)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:527)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
4

1 回答 1

0

正如我所怀疑的那样。错误处理周期会导致递归 NPE,正如 Polygnome 所说,JVM 由于 StackOverflowError 或 OutOfMemoryError 而崩溃。无论如何,谢谢你们。

于 2014-01-07T14:25:48.253 回答