问题描述
我写了一个struts2项目报了这样的错误:Unabletoloadconfiguration.-bean-jar:file:/D:/Tomcat%206.0/webapps/MyStruts2/WEB-INF/lib/struts2-core-2.1.6.jar!/struts-default.xml:68:140atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)atorg.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)atorg.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)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:3693)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4342)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)atorg.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)atorg.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)atorg.apache.catalina.core.StandardHost.start(StandardHost.java:719)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)atorg.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)atorg.apache.catalina.core.StandardService.start(StandardService.java:448)atorg.apache.catalina.core.StandardServer.start(StandardServer.java:710)atorg.apache.catalina.startup.Catalina.start(Catalina.java:552)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(UnknownSource)atsun.reflect.DelegatingMethodAccessorImpl.invoke(UnknownSource)atjava.lang.reflect.Method.invoke(UnknownSource)atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)Causedby:Unabletoloadbean:type:com.opensymphony.xwork2.util.ValueStackFactoryclass:com.opensymphony.xwork2.ognl.OgnlValueStackFactory-bean-jar:file:/D:/Tomcat%206.0/webapps/MyStruts2/WEB-INF/lib/struts2-core-2.1.6.jar!/struts-default.xml:68:140atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:222)atorg.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)atcom.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:165)atcom.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)...30moreCausedby:java.lang.NoClassDefFoundError:ognl/NullHandleratjava.lang.Class.getDeclaredConstructors0(NativeMethod)atjava.lang.Class.privateGetDeclaredConstructors(UnknownSource)atjava.lang.Class.getDeclaredConstructors(UnknownSource)atcom.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:212)...33more2009-4-511:43:15org.apache.catalina.core.StandardContextstart严重:ErrorfilterStart2009-4-511:43:15org.apache.catalina.core.StandardContextstart严重:Context[/MyStruts2]startupfailedduetopreviouserrors我已经加了commom-io,common-fileupload包
解决方案
解决方案二:
我运行tomcat的时候也报这个错啊,这个问题你解决了吗?