嚴重: Dispatcher initialization failed java.lang.RuntimeException: java.lang.reflect.InvocationTargetException處理方法:一、覈對lib包 commons-fileupload-1.2.1.jar, java
commons-io-1.3.2.jar web
commons-logging-1.0.4.jar apache
freemarker-2.3.16.jar tomcat
ognl-3.0.jar app
struts2-core-2.2.1.jar spa
xwork-core-2.2.1.jar xml
注意2.1之前是沒有commons-fileupload-1.2.1.jar。 get
二、若是struts2版本是2.1之前web.xml配置過濾器的時候應該是這樣:<filter-class>org.apache.struts2.dispatcher.FilterDispatcher </filter-class> it
若是struts2 版本是2.1以上web.xml配置 <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> io
三、 在使用struts-2.2.1時,須要引入javassist-3.7.ga.jar,而這個在struts-2.2.1\lib下是沒有的,須要在struts-2.2.1\apps\struts2-blank-2.2.1.war下的lib中找。
四、使用struts2.3以上的版本須要依賴更多的包,具體看tomcat啓動出錯狀況