Struts2注解报错"Dispatcher initialization failed"

严重: Dispatcher initialization failed
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
	at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
	at com.opensymphony.xwork2.inject.ContainerImpl$8.call(ContainerImpl.java:540)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:538)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:202)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
	at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
	at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
	... 29 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
	... 34 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)
	... 35 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
	at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
	at com.opensymphony.xwork2.inject.ContainerImpl$8.call(ContainerImpl.java:540)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:538)
	at org.apache.struts2.convention.ClasspathConfigurationProvider.<init>(ClasspathConfigurationProvider.java:47)
	... 40 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
	at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
	at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
	... 46 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
	... 51 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)
	... 52 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
	at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
	at com.opensymphony.xwork2.inject.ContainerImpl$8.call(ContainerImpl.java:540)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:538)
	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.<init>(PackageBasedActionConfigBuilder.java:129)
	... 57 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
	at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
	at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
	... 63 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295)
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:431)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
	... 68 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
	... 70 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
	at org.apache.struts2.convention.SEOActionNameBuilder.setActionSuffix(SEOActionNameBuilder.java:55)
	... 75 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
	... 76 more
2012-3-27 11:07:25 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter myStruts2
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerBuilder$4
File: ContainerBuilder.java
Method: create
Line: 132 - com/opensymphony/xwork2/inject/ContainerBuilder.java:132:-1
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
	at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
	at com.opensymphony.xwork2.inject.ContainerImpl$8.call(ContainerImpl.java:540)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:538)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:202)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
	... 20 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
	at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
	at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
	... 29 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
	... 34 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)
	... 35 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
	at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
	at com.opensymphony.xwork2.inject.ContainerImpl$8.call(ContainerImpl.java:540)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:538)
	at org.apache.struts2.convention.ClasspathConfigurationProvider.<init>(ClasspathConfigurationProvider.java:47)
	... 40 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
	at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
	at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
	... 46 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
	... 51 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)
	... 52 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
	at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
	at com.opensymphony.xwork2.inject.ContainerImpl$8.call(ContainerImpl.java:540)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:538)
	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.<init>(PackageBasedActionConfigBuilder.java:129)
	... 57 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
	at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
	at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
	at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
	... 63 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295)
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:431)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
	... 68 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
	... 70 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
	at org.apache.struts2.convention.SEOActionNameBuilder.setActionSuffix(SEOActionNameBuilder.java:55)
	... 75 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
	... 76 more

明确说下自己的解决方法吧


jar包版本不匹配

struts2-core-2.1.8.1.jar

struts2-convention-plugin-2.3.1.2.jar

一个是2.1,一个是2.3


我把2.3的换回2.1版本就没问题了

struts2-convention-plugin-2.1.8.1.jar


其他情况遇到再说

你可能感兴趣的:(exception,struts,jar,filter,Class,initialization)