为什么NPE会导致JVM崩溃?

时间:2013-12-25 15:54:09

标签: struts2 error-handling jvm-crash thread-state

我们正在将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)

1 个答案:

答案 0 :(得分:0)

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