问题描述
严重: Dispatcher initialization failedjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionat 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.getInstance(ContainerImpl.java:517)at com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:548)at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:546)at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:197)at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)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.initFilter(ApplicationFilterConfig.java:277)at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)at java.util.concurrent.FutureTask.run(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)at java.lang.Thread.run(Unknown Source)Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionat 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)... 26 moreCaused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionat com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)... 31 moreCaused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)at java.lang.reflect.Constructor.newInstance(Unknown Source)at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)... 32 moreCaused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/xwork/StringUtilsat org.apache.struts2.spring.StrutsSpringObjectFactory.<init>(StrutsSpringObjectFactory.java:104)... 37 moreCaused by: java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtilsat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)... 38 more2012-11-26 17:32:49 org.apache.catalina.core.StandardContext filterStart严重: Exception starting filter struts2java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerBuilder$4File: ContainerBuilder.javaMethod: createLine: 132 - com/opensymphony/xwork2/inject/ContainerBuilder.java:132:-1at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)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.initFilter(ApplicationFilterConfig.java:277)at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)at java.util.concurrent.FutureTask.run(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)at java.lang.Thread.run(Unknown Source)Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionat 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.getInstance(ContainerImpl.java:517)at com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:548)at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:546)at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:197)at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)... 16 moreCaused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionat 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)... 26 moreCaused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionat com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)... 31 moreCaused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)at java.lang.reflect.Constructor.newInstance(Unknown Source)at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)... 32 moreCaused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/xwork/StringUtilsat org.apache.struts2.spring.StrutsSpringObjectFactory.<init>(StrutsSpringObjectFactory.java:104)... 37 moreCaused by: java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtilsat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)... 38 more 问题补充:这几个jar包没有显示出来antlr-2.7.6.jar、commons-dbcp.jar、commons-fileupload-1.2.2.jar、struts2-core-2.2.3.jar、struts2-spring-plugin-2.1.8.1.jar、xwork-core-2.2.3.jar。或者哪位有完整的整合项目发给我也可以,感激不尽啊
解决方案
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/xwork/StringUtils xwork-core jar包不对
解决方案二:
应该是少jar包导致的,我这里有个实例,你可以看看