Environment
JBoss 6.0 + myeclipse 8.6 + MySQL 5.1 + Struts 2.3 + EJB 3.0
Problem
The following exception occurs when JBoss is started: Dispatcher initialization failedjava. Lang. runtimeexception: Java. Lang. Reflect. invocationtargetexception
Solution
Check whether the struts version and web. xml filter configurations are consistent.
Struts2 versions earlier than 2.1
Web. xml filter configuration
<web-app> <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>
If struts2
Version 2.1 or above
Web. xml filter configuration
<web-app> <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>
References
Http://blog.csdn.net/helifengwell/article/details/5855144
Http://rani.iteye.com/blog/794360
|
|
@ Wentasy blog is for your reference only. Welcome to visit. I hope to criticize and correct any mistakes. If you need to repost the original blog post, please indicate the source. Thank you for the [csdn blog] |