一尘不染

Tomcat中的线程“ PoolCleaner [{a number}]”中的异常

tomcat

我已经使用apache CXF实现了Rest Web
Service,并且已经设置了中提供的Tomcat连接池org.apache.tomcat.jdbc.pool

一切似乎都可以正常工作,并且我的连接池可以正常工作,但是我一直在收到与NET相关的异常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

为什么会这样?如何跟踪其根本原因?我该如何解决?

谢谢


阅读 791

收藏
2020-06-16

共1个答案

一尘不染

发生这种情况是因为缺少jar文件或更改了jar文件的版本。

花了一天的时间,我得到了解决方案。

2020-06-16