读书人

Struts2的一个有关问题!Caused by: ja

发布时间: 2012-10-31 14:37:31 作者: rapoo

Struts2的一个问题!Caused by: java.lang.NoClassDefFoundError: org/springframework/cont
关键字: struts2
问题:

Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware

原因:

Struts2的struts2-spring-plugin-2.0.11.jar等jar包需要使用ApplicationContextAware 去找Spring的

Context,结果ApplicationContextAware类都找不到!

解决方法(选择一种方法即可):

方法1.在Struts2项目中只保留Struts2的5个必须的包,其他全部删除

5个必须的包是:
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
struts2-core-2.0.11.1.jar
xwork-2.0.4.jar

方法2:

你的项目需要Spring的话,把Spring的包加进来也可以!




摘自:http://blog.csdn.net/liuxiaotao008/archive/2008/07/18/2672200.aspx

读书人网 >Ruby Rails

热点推荐