struts2升级到2.3.16

旧项目struts 2.1.8.1 + spring 3.0.3 + hibernate3  spring-security2.0.5
struts2爆出漏洞,对原项目升级struts2
以下为需要用到jar
asm-3.3.jar
asm-tree-3.3.jar
asm-commons-3.3.jar
cglib-2.2.jar
commons-io-2.2.jar
commons-lang-2.4.jar
commons-lang3-3.1.jar

struts2-core-2.3.16.1.jar
struts2-spring-plugin-2.3.16.1.jar
struts2-json-plugin-2.3.16.1.jar
struts2-cdi-plugin-2.3.16.1.jar
struts2-codebehind-plugin-2.3.16.1.jar
struts2-config-browser-plugin-2.3.16.1.jar
struts2-convention-plugin-2.3.16.1.jar
struts2-dwr-plugin-2.3.16.1.jar
freemarker-2.3.19.jar
ognl-3.0.6.jar
xwork-core-2.3.16.1.jar
启动后报错:
1、 NoClassDefFoundError:com/opensymphony/xwork2/util/finder/ClassFinder$InfoBuildingVisitor
asm-3.3.jar

2、 Caused by: Cannot locate the chosen ObjectFactory implementation:spring - [unknown location]
由于缺少了与spring连接的jar struts2-spring-plugin-2.3.16.1.jar

3、 Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
开始用的cglib包是cglib-2.1.3.jar  ,后来换了一个cglib-2.2.jar

4、 Caused by: java.lang.ClassNotFoundException: Login!loginAction
原来已有的action突然找不到,原来新的struts2默认禁用,动态调用action方法
because struts2.3.15.1升级后 s:submit method not work action's method
要在struts.properties里面加
struts.enable.DynamicMethodInvocation = true
或者
<constant name="struts.enable.DynamicMethodInvocation" value="true" />

你可能感兴趣的:(struts2)