严重: Dispatcher initialization failed java.lang.RuntimeException
嚴重: Dispatcher initialization failed java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
處理方法:
1、核對lib包
commons-fileupload-1.2.1.jar,
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
freemarker-2.3.16.jar
ognl-3.0.jar
struts2-core-2.2.1.jar
xwork-core-2.2.1.jar
注意2.1以前是沒有commons-fileupload-1.2.1.jar,
2、如果struts2版本是2.1以前
web.xml配置過濾器的時候應該是這樣:
?
<web-app version="2.5"
?xmlns="http://java.sun.com/xml/ns/javaee"
?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
?xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
?http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
? <welcome-file-list>
??? <welcome-file>index</welcome-file>
? </welcome-file-list>
? <filter>
???????? <filter-name>struts2</filter-name>??
??????? <filter-class>??
??????????? org.apache.struts2.dispatcher.FilterDispatcher??
??????? </filter-class>??
??? </filter>?
? <filter-mapping>
? ?<filter-name>struts2</filter-name>
? ?<url-pattern>/*</url-pattern>
? </filter-mapping>
?
</web-app>
如果struts2 版本是2.1以上
web.xml配置
?
3、
在使用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中找。
希望大家可以順利解決。
轉載于:https://blog.51cto.com/quake/533244
總結
以上是生活随笔為你收集整理的严重: Dispatcher initialization failed java.lang.RuntimeException的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何挂载initrd.img文件(简单三
- 下一篇: 【转载】尝试使用GraphicsMagi