1. Console错误: Exception starting filter struts2
File: ContainerImpl.java
解决:struts.xml位置不对。
2. Console错误:Exception starting filter struts2
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
解决:缺少包:commons-lang3-3.1.jar
3. Console错误:Could not create JarEntryRevision for[jar:file:D:/application/apache-tomcat-6.0.30/webapps/SSH1/WEB-INF/lib/struts2-core-2.3.4.jar]!
java.lang.NoClassDefFoundError:org/apache/commons/io/FileUtils
缺少包:commons-io-2.0.1.jar
4. Console错误:Dispatcher initialization failed
java.lang.RuntimeException:java.lang.reflect..InvocationTargetExceptio n
缺少包:javassist-3.11.0.GA.jar
5. Console错误:Caught exception while loading file struts-default.xml - [unknown location]
解决:由于lib包冲突造成的,将两个解析xml用的jar从项目里移到tomacat的lib下面就ok了,xml-apis.jar xerces-2.6.2.jar
6. Console错误:Exception starting filter struts2
原因:在web.xml已声明使用模板,并对所有的类进行了监听,但在处理过程中,发现不知道到哪里去找模板的配置文件,即在struts.xml中已使用了模板,但并没有告诉程序应该到哪去解析这些内容,即titles-default.java文件应该声明出来,
7. 执行增加操作时,直接对对象进行操作,对象中各字段值都正确,但插入数据库后乱码
8. 在进行页面跳转时,已经跳转到了相应的页面,但显示结果页面不正确。
解决:检查模板中的各个属性是否正确配置,尤其注意有的属性会忘记配置。
9. Nosuchdefinition titles...
解决: tiles.xml文件中的配置有问题,尤其注意name属性
10. No result defined for action ***Action and result success
解决:这个错误产生的原因是,在struts.xml中配置没有配置success result。我的理解是action执行完后,必须产生一个result类。这个类可是servlet或是其他,但不能为空。
11. No result defined for action ***Action and result input
解决:这个错误,在提交数据时经常碰到。定义的struts2 intercept发挥了作用,当POJO类型与输入的类型不同时,intercept类会中止拦截,并返回输入页面。详细的错误可在使用来获取。
12. There is no Action mapped for namespace / and action name ***Action
解决:可以直译为没有找到这个action,也就是说在struts.xml中没有定义这个action。这个错误一般是action的名字拼写错误造成的,请仔细检查struts.xml的定义与页面的acrion是否一致。
13. Class ognl.OgnlRuntime can not access a member of class ***Action with modifiers "private"
解决:关键字是"private",action类中的字段为private,这样页面(如jsp)是无法访问到的,这也是struts2面向对象的一大特征。