问题描述
2014-11-2712:29:51,592INFO[com.opensymphony.xwork2.config.providers.XmlConfigurationProvider]-Parsingconfigurationfile[struts.xml]2014-11-2712:29:51,674ERROR[org.apache.struts2.dispatcher.Dispatcher]-Dispatcherinitializationfailedjava.lang.RuntimeException:java.lang.RuntimeException:java.lang.RuntimeException:java.lang.reflect.InvocationTargetExceptionatcom.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)atcom.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:517)atcom.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:548)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:546)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:197)atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)atorg.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)atorg.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)atorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)atorg.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)atorg.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)atorg.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)atorg.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4651)atorg.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)atorg.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)atorg.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)atorg.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)atorg.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)atorg.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)atjava.lang.Thread.run(Thread.java:619)Causedby:java.lang.RuntimeException:java.lang.RuntimeException:java.lang.reflect.InvocationTargetExceptionatcom.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)atcom.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)atcom.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)atcom.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)atcom.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)...26moreCausedby:java.lang.RuntimeException:java.lang.reflect.InvocationTargetExceptionatcom.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:440)atcom.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)...31moreCausedby:java.lang.reflect.InvocationTargetExceptionatsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)atjava.lang.reflect.Constructor.newInstance(Constructor.java:513)atcom.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:419)...32moreCausedby:java.lang.NoClassDefFoundError:org/springframework/web/context/WebApplicationContextatorg.apache.struts2.spring.StrutsSpringObjectFactory.<init>(StrutsSpringObjectFactory.java:80)...37moreCausedby:java.lang.ClassNotFoundException:org.springframework.web.context.WebApplicationContextatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)atjava.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)...38more
解决方案
解决方案二:
貌似没加载到你的配置文件啊!!
解决方案三:
看下你的web。xml中<filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class><init-param><param-name>actionPackages</param-name><param-value>com.cmcc</param-value></init-param></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping>有没有配对然后看下struts.xml是否规范
解决方案四:
貌似是struts.xml没配置正确
解决方案五:
一看就知道web.xml文件配置错误、监听都没有配置、还有context没有配置、
解决方案六:
Causedby:java.lang.NoClassDefFoundError:org/springframework/web/context/WebApplicationContextatorg.apache.struts2.spring.StrutsSpringObjectFactory.<init>(StrutsSpringObjectFactory.java:80)...37moreCausedby:java.lang.ClassNotFoundException:org.springframework.web.context.WebApplicationContextatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)从jar配置文件看看是不是少了。