com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance

阅读更多

Struts2启动异常
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里面加上

org.springframework.web.context.ContextLoaderListener

你可能感兴趣的:(com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance)