at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:209)


Class: com.opensymphony.xwork2.spring.SpringObjectFactory
File: SpringObjectFactory.java
Method: getClassInstance
Line: 209 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:209:-1
Caused by: java.lang.NullPointerException  at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:209)

 

原因兩個:
1.lib中多導入包的大原因:去掉struts2-spring-plugin-2.1.8包即可,因為沒有用到spring。
2.還有的原因是用spring了,卻沒加監聽器,在web.xml里面加上
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

3.友情提示:新手請注意單詞不要寫錯,記不住這么長的話教大家個方便快捷的方法
在spring配置applicationContext.xml文檔中<bean class="在這里只要大概記得一些單詞按ALT+/會有自動提示"/>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM