java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation

1、错误描述

严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener  
java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation  
    at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:165)  
    at org.apache.log4j.Category.forcedLog(Category.java:391)  
    at org.apache.log4j.Category.log(Category.java:856)  
    at org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:229)  
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:543)  
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:516)  
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:827)  
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:485)  
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:921)  
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:895)  
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)  
    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:579)  
    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)  
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776)  
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)  
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)  
    at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3739)  
    at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1363)  
    at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1336)  
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1534)  
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:285)  
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)  
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)  
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1141)  
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377)  
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)  
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1349)  
    at java.lang.Thread.run(Thread.java:745)  
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.spi.ThrowableInformation  
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1313)  
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1164)  
    ... 28 more  
四月 10, 2017 10:52:56 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc  
警告: The web application [cmp] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.  
四月 10, 2017 10:52:56 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc  
警告: The web application [cmp] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.  
四月 10, 2017 10:52:56 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads  
警告: The web application [cmp] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:  
 java.lang.Object.wait(Native Method)  
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)  
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)  
四月 10, 2017 10:52:56 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads  
警告: The web application [cmp] appears to have started a thread named [Druid-ConnectionPool-Create-1065348511] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:  
 sun.misc.Unsafe.park(Native Method)  
 java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)  
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)  
 com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1824)  
四月 10, 2017 10:52:56 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads  
警告: The web application [cmp] appears to have started a thread named [Druid-ConnectionPool-Destroy-1065348511] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:  
 java.lang.Thread.sleep(Native Method)  
 com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1898)  
四月 10, 2017 10:52:56 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads  
警告: The web application [cmp] appears to have started a thread named [shiroCache] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:  
 java.lang.Object.wait(Native Method)  
 java.lang.Object.wait(Object.java:502)  
 java.util.TimerThread.mainLoop(Timer.java:526)  
 java.util.TimerThread.run(Timer.java:505)  
四月 10, 2017 10:52:56 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads  
警告: The web application [cmp] appears to have started a thread named [SessionValidationThread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:  
 sun.misc.Unsafe.park(Native Method)  
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)  
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)  
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)  
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)  
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)  
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)  
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
 java.lang.Thread.run(Thread.java:745)  

2、错误原因
在项目启动时,出现这个错误,由错误提示可知是缺少jar,有关log4j的

3、解决办法

(1)检查Maven有没有将log4j有关jar下载下来

(2)重新编译项目,利用mvn clean install

(3)重新启动Tomcat服务器
转载于http://blog.csdn.net/you23hai45/article/details/70112462

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值