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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM