为什么Tomcat关闭时会抛出NoClassDefFoundError?

我的项目包括Apache commons-* library .
在tomcat关闭时抛出异常,如果运行默认示例则没有异常 .

catalina out

信息:非法访问:此Web应用程序实例已被停止 . 无法加载org.apache.log4j.spi.ThrowableInformation . 最终跟随堆栈跟踪是由于为调试目的而抛出的错误以及尝试终止导致非法访问的线程引起的,并且没有功能影响 .

信息:非法访问:此Web应用程序实例已被停止 . 无法加载org.apache.log4j.spi.ThrowableInformation . 最终跟随堆栈跟踪是由于为调试目的而抛出的错误以及尝试终止导致非法访问的线程引起的,并且没有功能影响 .

INFO: Destroying ProtocolHandler ["http-bio-8080"]
Sep 24, 2012 4:00:14 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance ses ahas been stopped already.  Could not load org.apache.commons.pool.impl.CursorableLinkedList$Cursor.  The eventual following stack trace is caused by an error thrown for debugging purpos well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.

java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1600)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at org.apache.commons.pool.impl.CursorableLinkedList.cursor(CursorableLinkedList.java:305)
    at org.apache.commons.pool.impl.GenericObjectPool.evict(GenericObjectPool.java:1536)
    at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1749)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)

Exception in thread "Timer-0" java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/CursorableLinkedList$Cursor
    at org.apache.commons.pool.impl.CursorableLinkedList.cursor(CursorableLinkedList.java:305)
    at org.apache.commons.pool.impl.GenericObjectPool.evict(GenericObjectPool.java:1536)
    at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1749)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)


Caused by: java.lang.ClassNotFoundException: org.apache.commons.pool.impl.CursorableLinkedList$Cursor
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    ... 5 more

回答(0)