问题描述
SSH的一个项目,错误如下,请大神帮忙这是struts2的包严重: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:514)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524)atcom.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:580)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:227)atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)atorg.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)atorg.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)atorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)atorg.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)atorg.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)atorg.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)atorg.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)atorg.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)atjava.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)atjava.util.concurrent.FutureTask.run(FutureTask.java:138)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)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:502)atcom.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:589)atcom.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537)atcom.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)atcom.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)...29moreCausedby:java.lang.RuntimeException:java.lang.reflect.InvocationTargetExceptionatcom.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:447)atcom.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:499)...34moreCausedby: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:426)...35moreCausedby:java.lang.NoClassDefFoundError:org/apache/commons/lang/xwork/StringUtilsatorg.apache.struts2.spring.StrutsSpringObjectFactory.<init>(StrutsSpringObjectFactory.java:104)...40moreCausedby:java.lang.ClassNotFoundException:org.apache.commons.lang.xwork.StringUtilsatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)atjava.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)...41more2015-2-916:27:11org.apache.catalina.core.StandardContextfilterStart严重:Exceptionstartingfilterstruts2java.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:-1atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:450)atorg.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)atorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)atorg.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)atorg.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)atorg.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)atorg.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)atorg.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)atjava.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)atjava.util.concurrent.FutureTask.run(FutureTask.java:138)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)atjava.lang.Thread.run(Thread.java:619)Causedby:java.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:514)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524)atcom.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:580)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:227)atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)atorg.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)...19moreCausedby:java.lang.RuntimeException:java.lang.RuntimeException:java.lang.reflect.InvocationTargetExceptionatcom.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502)atcom.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:589)atcom.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537)atcom.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)atcom.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)...29moreCausedby:java.lang.RuntimeException:java.lang.reflect.InvocationTargetExceptionatcom.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:447)atcom.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:499)...34moreCausedby: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:426)...35moreCausedby:java.lang.NoClassDefFoundError:org/apache/commons/lang/xwork/StringUtilsatorg.apache.struts2.spring.StrutsSpringObjectFactory.<init>(StrutsSpringObjectFactory.java:104)...40moreCausedby:java.lang.ClassNotFoundException:org.apache.commons.lang.xwork.StringUtilsatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)atjava.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)...41more2015-2-916:27:11org.apache.catalina.core.StandardContextstartInternal严重:ErrorfilterStart
解决方案
解决方案二:
就这几个jar???不是ssh吗?你的struts2springLibraries呢?
解决方案三:
LZ,这是我的struts2的library。我看到你是分发器初始化出现的错误。能把你的web.xml文件内容贴上来不?
解决方案四:
Causedby:java.lang.ClassNotFoundException:org.apache.commons.lang.xwork.StringUtils可能是xwork.jar包有问题在struts的app文件下的struts2-blank.war的压缩包里的WEB-INF/lib下有这个文件xwork-xxxxx.jar,将这个文件放在你的项目的lib下试一下
解决方案五:
还有一个commons-pool-1.6
解决方案六:
这是web.xml<?xmlversion="1.0"encoding="UTF-8"?><web-appid="WebApp_9"version="2.4"xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><display-name>StrutsBlank</display-name><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><context-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/classes/applicationContext.xml</param-value></context-param><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><welcome-file-list><welcome-file>index.html</welcome-file></welcome-file-list></web-app>
解决方案七:
Causedby:java.lang.ClassNotFoundException:org.apache.commons.lang.xwork.StringUtils,这都说了没有这个jar包,jar包不完整
解决方案八:
楼主是缺少jar包
解决方案九:
缺少好多包的说。。。http://javafly-zz.iteye.com/blog/1490406看看这个基本对需要的包有介绍
解决方案十:
少JAR包了,myeclipse可以直接引入相关jar包