[Java] SSH框架笔记_Struts2配置问题
1、Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/D:/Program%20Files/apache-tomcat-6.0.35/webapps/StrutsPro/WEB-INF/lib/struts2-core-2.3.4.jar!/struts-default.xml:29:72
是由于tomcat本身的lib就有struts需要的包,而我們又自己添加了包而產生的沖突。
?
2、只添加了5個包是不夠的xwork-x.x.x.jar、commons-logging-x.x.x.jar、freemarker-x.x.x.jar、ognl-x.x.x.jar、struts2-core-x.x.x.jar)
問題:嚴重: Dispatcher initialization failed
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
解決方法:添加javassist-x.x.x.ga.jar
問題:警告: Could not create JarEntryRevision for [jar:file:/D:/Program%20Files/apache-tomcat-6.0.35/webapps/StrutsPro/WEB-INF/lib/struts2-core-2.3.4.jar]!
java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
解決方法:添加commons-io-x.x.x.jar
問題:嚴重: Exception starting filter struts2
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
解決方法:添加commons-langx.x.x.jar
問題:嚴重: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/D:/Program%20Files/apache-tomcat-6.0.35/webapps/StrutsPro/WEB-INF/lib/struts2-core-2.3.4.jar!/struts-default.xml:51:178
Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.RequestContext
解決方法:添加commons-fileupload-x.x.x.jar
轉載于:https://www.cnblogs.com/jqmtony/p/3947834.html
總結
以上是生活随笔為你收集整理的[Java] SSH框架笔记_Struts2配置问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 工作流现状
- 下一篇: xunsearch: 开启后台服务,索引