最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Struts22.3升级2.5.22版本遇到的问题

旗下网站admin37浏览0评论

Struts2  2.3升级2.5.22版本遇到的问题

Struts2 2.3升级2.5.22版本遇到的问题

jdk 1.7
升级jar包
asm-7.0.jar
asm-commons-7.0.jar
asm-tree-7.0.jar
commons-fileupload-1.3.3.jar
commons-io-2.5.jar
commons-lang3-3.6.jar
commons-logging-1.1.3.jar
freemarker-2.3.23-incubating.jar
javassist-3.23.0-GA.jar
log4j-api-2.12.1.jar
log4j-core-2.12.1.jar
ognl-3.1.15.jar
struts2-config-browser-plugin-2.5.22.jar
struts2-convention-plugin-2.5.22.jar
struts2-core-2.5.22.jar
struts2-dojo-plugin-2…3.28.jar
struts2-json-plugin-2.5.22.jar
struts2-junit-plugin-2.5.22.jar
struts2-spring-plugin-2.5.22.jar

准备

struts2-config-browser-plugin 可以看到所有action 用法:http://ip:port/projectName/config-browser/actionNames.action
http://loaclhost:7001/项目名称/config-browser/actionNames.action

web.xml : <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
</filter-class>

struts2.xml 2.3–>2.5

其他:+Notes+2.5.22

遇到问题
1:
2:
3:加入 struts2-dojo-plugin-2.3.15.1 后 报错
Caused by: java.lang.NoClassDefFoundError: org/apache/struts2/views/TagLibrary

解决:
升级 struts2-dojo-plugin-2.3.28包

4:报错:14:09:58.637 [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] ERROR org.apache.struts2.convention.DefaultClassFinder - Unable to read class [com.server.action.******Action]
java.lang.IllegalArgumentException: null
at org.objectweb.asm.ClassVisitor.(Unknown Source) ~[asm-5.2.jar:5.2]
at org.objectweb.asm.ClassVisitor.(Unknown Source) ~[asm-5.2.jar:5.2] …

asm  asm-commons  asm-tree 版本升级到7.0

5:本地未报错 ,放到服务器上
Incorrectly typed data found for annotation element public abstract java.lang.String[] org.apache.struts2.convention.annotation.Result.name() (Found data of type class java.lang.String[***])

解决: name 为String[] 将之前的 (name=“expAll”) 修改为 (name={“expAll”}) 后,启动正常

6.报错 :There is no Action mapped for namespace [/] and action name [***!***] associated with context path [/******]
解决:struts 加入:<constant name=“struts.enable.DynamicMethodInvocation” value=“true”/>

7.报错 :Method tests for action json is not allowed
解决:2.5安全性 用的注解@AllowedMethods({“regex:.*”})

struts.xml:<global-allowed-methods>regex:.*</global-allowed-methods>

发布评论

评论列表(0)

  1. 暂无评论