问题描述
这就是后台错误代码:请哪位不吝赐教。Unabletoloadconfiguration.-bean-jar:file:/E:/Program%20Files/Tomcat%206.0/webapps/struts2/WEB-INF/lib/struts2-core-2.2.1.1.jar!/struts-default.xml:48:178atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)atorg.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)atorg.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)atorg.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)atorg.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)atorg.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)atorg.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4363)atorg.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1116)atorg.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)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:Unabletoloadbean:type:org.apache.struts2.dispatcher.multipart.MultiPartRequestclass:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest-bean-jar:file:/E:/Program%20Files/Tomcat%206.0/webapps/struts2/WEB-INF/lib/struts2-core-2.2.1.1.jar!/struts-default.xml:48:178atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:232)atorg.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180)atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)...17moreCausedby:java.lang.NoClassDefFoundError:org/apache/commons/fileupload/RequestContextatjava.lang.Class.getDeclaredConstructors0(NativeMethod)atjava.lang.Class.privateGetDeclaredConstructors(Class.java:2389)atjava.lang.Class.getDeclaredConstructors(Class.java:1836)atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:222)...20moreCausedby:java.lang.ClassNotFoundException:org.apache.commons.fileupload.RequestContextatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)...24more2011-3-3110:37:54org.apache.catalina.core.StandardContextfilterStart严重:Exceptionstartingfilterstruts2Unabletoloadconfiguration.-bean-jar:file:/E:/Program%20Files/Tomcat%206.0/webapps/struts2/WEB-INF/lib/struts2-core-2.2.1.1.jar!/struts-default.xml:48:178atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)atorg.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)atorg.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)atorg.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)atorg.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)atorg.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4363)atorg.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1116)atorg.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)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:Unabletoloadconfiguration.-bean-jar:file:/E:/Program%20Files/Tomcat%206.0/webapps/struts2/WEB-INF/lib/struts2-core-2.2.1.1.jar!/struts-default.xml:48:178atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)atorg.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)...15moreCausedby:Unabletoloadbean:type:org.apache.struts2.dispatcher.multipart.MultiPartRequestclass:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest-bean-jar:file:/E:/Program%20Files/Tomcat%206.0/webapps/struts2/WEB-INF/lib/struts2-core-2.2.1.1.jar!/struts-default.xml:48:178atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:232)atorg.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180)atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)...17moreCausedby:java.lang.NoClassDefFoundError:org/apache/commons/fileupload/RequestContextatjava.lang.Class.getDeclaredConstructors0(NativeMethod)atjava.lang.Class.privateGetDeclaredConstructors(Class.java:2389)atjava.lang.Class.getDeclaredConstructors(Class.java:1836)atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:222)...20moreCausedby:java.lang.ClassNotFoundException:org.apache.commons.fileupload.RequestContextatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)...24more2011-3-3110:37:54org.apache.catalina.core.StandardContextstart严重:ErrorfilterStart2011-3-3110:37:54org.apache.catalina.core.StandardContextstart严重:Context[/struts2]startupfailedduetopreviouserrors
解决方案
解决方案二:
struts-default.xml配置文件有问题!!!
解决方案三:
缺少commons-fileupload.jar把该加的jar包都加进去,看启动时报不报错
解决方案四:
貌似是core包下的struts-default.xml中第48行有问题
解决方案五:
明显的jar包问题,可能是重复struts2-core-2.2.1.1.jar,或者是缺少
解决方案六:
commons-fileupload.jar我加了这个包后又出来错误了,变了:严重:Dispatcherinitializationfailedjava.lang.RuntimeException:java.lang.reflect.InvocationTargetExceptionatcom.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295)atcom.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:431)atcom.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:207)atcom.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)atcom.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:93)atcom.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:487)atcom.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)atcom.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:252)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193)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.FilterDispatcher.init(FilterDispatcher.java:190)atorg.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)atorg.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)atorg.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)atorg.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4363)atorg.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1116)atorg.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)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.reflect.InvocationTargetExceptionatsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atcom.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)...28moreCausedby:java.lang.ExceptionInInitializerErroratcom.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:85)...33moreCausedby:java.lang.IllegalArgumentException:Javassistlibraryismissinginclasspath!Pleaseaddmisseddependency!atognl.OgnlRuntime.<clinit>(OgnlRuntime.java:165)...34moreCausedby:java.lang.ClassNotFoundException:javassist.ClassPoolatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)atjava.lang.Class.forName0(NativeMethod)atjava.lang.Class.forName(Class.java:169)atognl.OgnlRuntime.<clinit>(OgnlRuntime.java:162)...34more2011-3-3111:23:21org.apache.catalina.core.StandardContextfilterStart严重:Exceptionstartingfilterstruts2java.lang.reflect.InvocationTargetException-Class:com.opensymphony.xwork2.inject.ContainerImpl$MethodInjectorFile:ContainerImpl.javaMethod:injectLine:295-com/opensymphony/xwork2/inject/ContainerImpl.java:295:-1atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)atorg.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)atorg.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)atorg.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)atorg.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)atorg.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4363)atorg.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1116)atorg.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)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.reflect.InvocationTargetExceptionatcom.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295)atcom.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:431)atcom.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:207)atcom.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)atcom.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:93)atcom.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:487)atcom.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)atcom.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:252)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193)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)...15moreCausedby:java.lang.reflect.InvocationTargetExceptionatsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atcom.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)...28moreCausedby:java.lang.ExceptionInInitializerErroratcom.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:85)...33moreCausedby:java.lang.IllegalArgumentException:Javassistlibraryismissinginclasspath!Pleaseaddmisseddependency!atognl.OgnlRuntime.<clinit>(OgnlRuntime.java:165)...34moreCausedby:java.lang.ClassNotFoundException:javassist.ClassPoolatorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)atjava.lang.Class.forName0(NativeMethod)atjava.lang.Class.forName(Class.java:169)atognl.OgnlRuntime.<clinit>(OgnlRuntime.java:162)...34more2011-3-3111:23:21org.apache.catalina.core.StandardContextstart严重:ErrorfilterStart2011-3-3111:23:21org.apache.catalina.core.StandardContextstart严重:Context[/struts2]startupfailedduetopreviouserrors
解决方案七:
struts2-core-2.2.1.1.jar这个包我也已经加入了,
解决方案八:
core包下的struts-default.xml的具体位置是什么啊,我是菜鸟刚开始学,请您说明白点
解决方案九:
教程写错了
解决方案十:
楼主和我遇到的问题一样。我也是这几天才开始学的。我按照网上的教程来是没问题的,但我自己用Myeclipse添加的struts2支持就出错了。我感觉是struts2.1的struts.xml写法有问题。我到现在都没找到问题的根源。
解决方案十一:
kimyxl我解决了我加了一个jar包,咱们是少印了一个jar包,今天上午我找了一上午终于搞定了,你再加一个jar包到lib下,一共是这么多jar包:commons-fileupload-1.2.1.jar,commons-io-1.3.2.jarcommons-logging-1.0.4.jarfreemarker-2.3.16.jarognl-3.0.jarstruts2-core-2.2.1.jarxwork-core-2.2.1.jar你可能是少引了第一个包。你试试吧,
解决方案十二:
哥们我也是刚初学过来的,像这种错,百分之九十九都是struts.xml中的配置有错误。仔细检查一下
解决方案十三:
引用2楼gouxiongyaya的回复:
缺少commons-fileupload.jar把该加的jar包都加进去,看启动时报不报错
就是少了这个
解决方案十四:
commons-fileupload-1.2.1.jar,commons-io-1.3.2.jarcommons-logging-1.0.4.jarfreemarker-2.3.16.jarognl-3.0.jarstruts2-core-2.2.1.jarxwork-core-2.2.1.jar这个几个包是基本必须的了,然后你可以把你的web配置文件发上来看一下,好像是filter出了问题。
解决方案十五:
struts.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheSoftwareFoundation//DTDStrutsConfiguration2.1.7//EN""http://struts.apache.org/dtds/struts-2.1.7.dtd"><struts><!--响应Ajax请求的jsonResult--><packagename="myjson"extends="json-default"><actionname="login"class="action.loginAction"><resultname="success"type="json"></result><resultname="fail"type="json"></result></action><actionname="regist"class="action.registAction"><resultname="success">ok.jsp</result></action></package></struts>
web.xml:<?xmlversion="1.0"encoding="UTF-8"?><web-appversion="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"><filter><filter-name>Struts2Contorll</filter-name><filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class></filter><filter-mapping><filter-name>Struts2Contorll</filter-name><url-pattern>/*</url-pattern></filter-mapping></web-app>
如果没有用到ajax就把extends="json-default"改成struts-default实在不行,你的jar包有问题。。。
解决方案:
把引用的jar包目录,和配置文件贴一下!