I have implemented a Rest Web Service using apache CXF and I have set up the Tomcat's connection Pool provided in the org.apache.tomcat.jdbc.pool
.
Everything seems to work fine and my connection pool works but I am keep getting an exception related to the PoolCleaner
. The problem is that I cannot find a specific pattern on when this exception happens. It seems random to me and some times it different than the previous times. Sometimes happens when I start tomcat and other times when I access or deploy a web app.
So here is the exception that I get with its variations
Most of the times I get this:
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)
and sometimes I get this
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
Any ideas on why this is happening? How can I track its root cause? How can I resolve it?
Thanks