Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
1、错误描述
2014-7-12 0:38:57 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 2014-7-12 0:38:57 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:270) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 16 more 2014-7-12 0:38:57 com.sun.faces.config.ConfigureListener contextInitialized 信息: 初始化上下文 '/FirstSSH' 的 Mojarra 2.0.3 (FCS b03) 2014-7-12 0:38:57 com.sun.faces.spi.InjectionProviderFactory createInstance 信息: JSF1048:有 PostConstruct/PreDestroy 注释。标有这些注释的 ManagedBeans 方法将表示注释已处理。 2014-7-12 0:38:58 org.apache.catalina.core.StandardContext startInternal 严重: Error listenerStart 2014-7-12 0:38:58 org.apache.catalina.core.StandardContext startInternal 严重: Context [/FirstSSH] startup failed due to previous errors 2014-7-12 0:38:58 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 2014-7-12 0:38:58 org.apache.catalina.core.StandardContext listenerStop 严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.web.context.ContextCleanupListener.<clinit>(ContextCleanupListener.java:43) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5014) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5659) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 17 more 2014-7-12 0:38:58 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks 严重: The web application [/FirstSSH] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@11872a8]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 2014-7-12 0:38:58 org.apache.catalina.startup.HostConfig deployDirectory
2、错误原因
通过这句可知,“Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory”,缺少Struts2中的一个jar
3、解决办法
将“commons-logging-1.1.3.jar”复制到lib文件夹目录下
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory,古老的榕树,5-wow.com
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。