日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

严重: Dispatcher initialization failed java.lang.RuntimeException

發布時間:2025/4/16 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 严重: 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配置過濾器的時候應該是這樣:
?

  • <?xml version="1.0" encoding="UTF-8"?>
    <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配置

    ?

  • <?xml?version="1.0"?encoding="UTF-8"?>?
  • <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.jsp</welcome-file>?
  • ??</welcome-file-list>?
  • ?? ?
  • ??<filter>?
  • ?? ?
  • ????<filter-name>struts2</filter-name>?
  • ????<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>?
  • ???? ?
  • ??</filter>?
  • ?? ?
  • ??<filter-mapping>?
  • ?? ?
  • ????<filter-name>struts2</filter-name>?
  • ????<url-pattern>/*</url-pattern>?
  • ???? ?
  • ??</filter-mapping>?
  • ?? ?
  • </web-app>?
  • 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的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。