struts2.2以后配置以及所需的jar包

struts2.2以后配置以及所需的jar包

 (2013-04-15 17:19:04)
标签: 

错误

 

struts2.2

 

配置

 

jar包

 

运行环境

分类: Struts


如果加入以下四个包:

*struts2-core-2.2.1.1.jar,(内核)

*xwork-core-2.2.1.1jar(内核)

*freemarker-2.3.16.jar

*ornl-3.0.jar(表达式语言)

将会报以下错误:
严重: Exception starting filter struts2
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
添加了:
commons-lang3-3.1.jar
又会报下面错误:
严重: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/D:/JavaProject/OA/WebRoot/WEB-INF/lib/struts2-core-2.3.12.jar!/struts-default.xml:53:178

需要添加如下包:

*commons-fileupload-1.2.1.jar(关于文件下载)

*commons-io-1.3.2.jar(文件下载所要用的)

添加了以上的包后就可以运行了,但有时候也会报以下错误:
Javassist library is missing in classpath! Please add missed dependency!

这时我们就需要导入
javassist-3.7.ga.jar

这样我们的环境就基本上搭建好了。

总结:
在struts2.2以后,我们需要导入的包有以下几个:

commons-fileupload-1.2.1.jar

commons-io-1.3.2.jar

commons-logging-1.0.4.jar

commons-lang3-3.1.jar

freemarker-2.3.16.jar

javassist-3.7.ga.jar

ornl-3.0.jar

struts2-core-2.2.1.1.jar

xwork-core-2.2.1.1jar


如果在struts.xml中action配置错误,那么就出现以下出错。
严重: Exception starting filter struts2
Unable to load configuration. - action - file:/D:/JavaProject/OA/WebRoot/WEB-INF/classes/struts.xml:8:58


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章