每次运行程序报错,看见一堆的报错信息都会心慌,想请教大家:怎么学会看java异常报错的信息?
比如下面的报错信息
Exception use case name: bizGetSysName
com.primeton.tp.core.bizservice.ProcessException
at com.primeton.tp.core.bizservice.state.MethodBizState.invoke(MethodBizState.java:84)
at com.primeton.tp.core.bizservice.ProcessRunner.implement(ProcessRunner.java:187)
at com.primeton.tp.core.bizservice.ProcessCaller.implement_noEJB(ProcessCaller.java:230)
at com.primeton.tp.core.bizservice.ProcessCaller.implement(ProcessCaller.java:93)
at jsp_servlet._fbtools._page.__hiddensubmit._jspService(__hiddensubmit.java:216)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3214)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.primeton.tp.core.bizservice.state.MethodBizState.invoke(MethodBizState.java:79)
... 17 more
Caused by: java.lang.NoClassDefFoundError: com/starit/gejie/dao/SysNameDao
at com.starit.gejie.Util.Trans.BL_getSysNamesByType(Trans.java:220)
... 22 more
java异常Exception
比如下面的报错信息
Exception use case name: bizGetSysName
com.primeton.tp.core.bizservice.ProcessException
at com.primeton.tp.core.bizservice.state.MethodBizState.invoke(MethodBizState.java:84)
at com.primeton.tp.core.bizservice.ProcessRunner.implement(ProcessRunner.java:187)
at com.primeton.tp.core.bizservice.ProcessCaller.implement_noEJB(ProcessCaller.java:230)
at com.primeton.tp.core.bizservice.ProcessCaller.implement(ProcessCaller.java:93)
at jsp_servlet._fbtools._page.__hiddensubmit._jspService(__hiddensubmit.java:216)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3214)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1890)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.primeton.tp.core.bizservice.state.MethodBizState.invoke(MethodBizState.java:79)
... 17 more
Caused by: java.lang.NoClassDefFoundError: com/starit/gejie/dao/SysNameDao
at com.starit.gejie.Util.Trans.BL_getSysNamesByType(Trans.java:220)
... 22 more
java异常Exception
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.NoClassDefFoundError: com/starit/gejie/dao/SysNameDao
看Caused by: java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: com/starit/gejie/dao/SysNameDao
at com.starit.gejie.Util.Trans.BL_getSysNamesByType(Trans.java:220)
这些基本就能定位到了吧!
一般看报错部分的开头还有caused by 部分,找是自己写的类,其他看不懂的就先暂时忽略