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+/會有自動提示"/>