问题描述
导入包xwork-2.0.4.jar报log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).log4j:WARN Please initialize the log4j system properly.2011-4-2 14:59:48 org.apache.catalina.core.StandardContext filterStart严重: Exception starting filter struts2Unable to load bean: type:com.opensymphony.xwork2.util.ObjectTypeDeterminer class:com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer - bean - jar:file:/F:/WorkProgram/apache-tomcat-6.0.18/webapps/HelloWorld/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:36:148at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)at org.apache.catalina.core.StandardService.start(StandardService.java:516)at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)at org.apache.catalina.startup.Catalina.start(Catalina.java:578)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)Caused by: java.lang.NoClassDefFoundError: ognl/OgnlExceptionat java.lang.Class.getDeclaredConstructors0(Native Method)at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)at java.lang.Class.getDeclaredConstructors(Class.java:1836)at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:198)... 33 moreCaused by: java.lang.ClassNotFoundException: ognl.OgnlExceptionat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)... 37 more2011-4-2 14:59:48 org.apache.catalina.core.StandardContext start换成了xwork-2.1.2.jar时报的错:log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).log4j:WARN Please initialize the log4j system properly.2011-4-2 15:04:13 org.apache.catalina.core.StandardContext filterStart严重: Exception starting filter struts2Unable to load configuration. - bean - jar:file:/F:/WorkProgram/apache-tomcat-6.0.18/webapps/HelloWorld/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:36:148at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)at org.apache.catalina.core.StandardService.start(StandardService.java:516)at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)at org.apache.catalina.startup.Catalina.start(Catalina.java:578)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)Caused by: Unable to load bean: type:com.opensymphony.xwork2.util.ObjectTypeDeterminer class:com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer - bean - jar:file:/F:/WorkProgram/apache-tomcat-6.0.18/webapps/HelloWorld/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:36:148at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:222)at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:165)at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)... 30 moreCaused by: java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.GenericsObjectTypeDeterminerat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:146)at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:193)... 33 more大家帮忙看看吧,真的很纠结啊 问题补充:beipiaoonline 写道
解决方案
看看这个能帮上忙吗:http://blog.csdn.net/laiahu/archive/2007/10/30/1855998.aspx