问题描述
- ssh整合报错,出现了空指针
-
18-Feb-2016 23:52:29.943 INFO [RMI TCP Connection(3)-127.0.0.1] org.apache.struts2.config.AbstractBeanSelectionProvider.info Choosing bean (struts) for (org.apache.struts2.dispatcher.DispatcherErrorHandler)
18-Feb-2016 23:52:43.055 SEVERE [http-apr-8080-exec-2] org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler.error Exception occurred during processing request: null
java.lang.NullPointerException
at cn.itcast.action.EmployeeAction.execute(EmployeeAction.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)报错的位置
<!-- action实例交给spring容器创建 --> <action name="show" class="cn.itcast.action.EmployeeAction" method="execute"> <result name="SUCCESS">/index.jsp</result> </action> </package>
解决方案
cn.itcast.action.EmployeeAction的show方法的参数怎么写的,或者获取getParameter等参数没有获取到,调试下。
解决方案二:
at cn.itcast.action.EmployeeAction.execute(EmployeeAction.java:24)
24行是什么,,
解决方案三:
你把EmployeeAction 这个类贴出来看下,这个类的24行报错
解决方案四:
检查下EmployeeAction.java:24这个地方,有没有使用什么对象,调试下这些对象为什么为空?
空指针问题其实是很好定位和排查的,祝好!
时间: 2024-12-10 02:46:58