SP报空指针异常

2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家

java.lang.NullPointerException

at com.szjz.system.serviceImpl.UserManagementAddServiceImpl.AddUser(UserManagementAddServiceImpl.java:24)

at com.szjz.system.action.UserManagementAddAction.doExecute(UserManagementAddAction.java:84)

at com.szjz.system.utils.BaseAction.execute(BaseAction.java:22)

at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)

at com.szjz.system.utils.MyActionServlet.doPost(MyActionServlet.java:38)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.szjz.system.utils.EncodingFilter.doFilter(EncodingFilter.java:29)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)

at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)

at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)

at java.lang.Thread.run(Thread.java:595)

http://bbs.22cg.com/forum-113-1.html
http://bbs.22cg.com/forum-111-1.html
tcc55.com
70ky.com
http://flash.22cg.com/baoshijieyulecheng/
http://flash.22cg.com/yingfengguojiyulecheng/


解决方法:第一种:将你需要注入的参数设置为static的,然后将设值方法set**的返回值设置为非void型,比如你的

protected IDaoService daoService;//注入类的属性

改为

protected static IDaoService daoService;//注入类的属性
相关帖子
spring揭秘.pdf 高清pdf下载《spring framework开发参考手册》中文高清(pdf)下载spring缺包异常请人帮我⒀看看我的代码,报空指针的错误spring中webapplicationcontext的研究spring开发_spring构造注入beanspring security--filterspring 定时器spring包详解spring 触发器