[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

--------------------------------------

欢迎您,进入 我系程序猿 的cnBlog博客。

你不能改变你的过去,但你可以让你的未来变得更美好。一旦时间浪费了,生命就浪费了。

You cannot improve your past, but you can improve your future. Once time is wasted, life is wasted.

--------------------------------------

分享到QQ空间  

原文地址:https://www.cnblogs.com/jqmtony/p/3947834.html