我已经使用 apache CXF 实现了一个 Rest Web 服务,并且我已经设置了org.apache.tomcat.jdbc.pool
.
一切似乎工作正常,我的连接池工作,但我不断收到与PoolCleaner
. 问题是我找不到有关何时发生此异常的特定模式。这对我来说似乎是随机的,有时它与以前不同。有时在我启动 tomcat 时发生,有时在我访问或部署 Web 应用程序时发生。
所以这是我得到的例外情况
大多数时候我得到这个:
Exception in thread "PoolCleaner[28224875:1372776292150]" java.lang.NullPointerException
at org.apache.tomcat.jdbc.pool.ConnectionPool.unregisterCleaner(ConnectionPool.java:1296)
at org.apache.tomcat.jdbc.pool.ConnectionPool.access$400(ConnectionPool.java:57)
at org.apache.tomcat.jdbc.pool.ConnectionPool$PoolCleaner.stopRunning(ConnectionPool.java:1364)
at org.apache.tomcat.jdbc.pool.ConnectionPool$PoolCleaner.run(ConnectionPool.java:1341)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
有时我得到这个
INFO: Illegal access: this web application instance has been stopped already. Could not load org.apache.tomcat.jdbc.pool.FairBlockingQueue$FairIterator. The eventual following stack trace is caused by an error thrown for debugging purposes as 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:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.tomcat.jdbc.pool.FairBlockingQueue.iterator(FairBlockingQueue.java:233)
at org.apache.tomcat.jdbc.pool.ConnectionPool.testAllIdle(ConnectionPool.java:1034)
at org.apache.tomcat.jdbc.pool.ConnectionPool$PoolCleaner.run(ConnectionPool.java:1352)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Exception in thread "PoolCleaner[6345204:1372865832250]" java.lang.NoClassDefFoundError: org/apache/tomcat/jdbc/pool/FairBlockingQueue$FairIterator
at org.apache.tomcat.jdbc.pool.FairBlockingQueue.iterator(FairBlockingQueue.java:233)
at org.apache.tomcat.jdbc.pool.ConnectionPool.testAllIdle(ConnectionPool.java:1034)
at org.apache.tomcat.jdbc.pool.ConnectionPool$PoolCleaner.run(ConnectionPool.java:1352)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool.FairBlockingQueue$FairIterator
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
... 5 more
关于为什么会发生这种情况的任何想法?如何追踪其根本原因?我该如何解决?
谢谢