0

I have a Java / Spring MVC web application running in Eclipse.

The application runs fine.

However, every few minutes the Eclipse debugger jumps to a part of the class Timer.class and I get the following error ...

Exception in thread "Timer-0" java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$AsyncTestIdleResourceTask

... and the application runs fine otherwise.

Why is Eclipse debug complaining with ClassNotFound?

Full stack trace here:

Exception in thread "Timer-0" java.lang.NoClassDefFoundError: com/mchange/v2/resourcepool/BasicResourcePool$AsyncTestIdleResourceTask
    at com.mchange.v2.resourcepool.BasicResourcePool.checkIdleResources(BasicResourcePool.java:1481)
    at com.mchange.v2.resourcepool.BasicResourcePool.access$2000(BasicResourcePool.java:32)
    at com.mchange.v2.resourcepool.BasicResourcePool$CheckIdleResourcesTask.run(BasicResourcePool.java:1964)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1368)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1218)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180)
    ... 5 more
Caused by: java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1378)
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1366)
    ... 7 more
Sep 30, 2020 11:25:37 AM org.apache.catalina.loader.WebappClassLoaderBase checkStateForResourceLoading
INFO: Illegal access: this web application instance has been stopped already. Could not load [org.apache.commons.collections4.map.AbstractLinkedMap$LinkMapIterator]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.apache.commons.collections4.map.AbstractLinkedMap$LinkMapIterator]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1378)
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1366)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1218)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180)
    at org.apache.commons.collections4.map.AbstractLinkedMap.mapIterator(AbstractLinkedMap.java:354)
    at com.crunchify.CrunchifyInMemoryCache.cleanup(CrunchifyInMemoryCache.java:107)
    at com.crunchify.CrunchifyInMemoryCache$1.run(CrunchifyInMemoryCache.java:43)
    at java.lang.Thread.run(Thread.java:748)
AvaTaylor
  • 623
  • 4
  • 16
  • @user1438038 Maybe ... if I understand correctly the problem is there's two "com/mchange/v2/resourcepool/BasicResourcePool$AsyncTestIdleResourceTask" classes -- one in my WAR and one in the Tomcat lib. Question ... how can I determine which JAR in the tomcat lib has this class? – AvaTaylor Sep 30 '20 at 15:47
  • @user1438038 It looks like that class "com/mchange/..." is in my project in the "c3p0-0.9.1.2.jar" file ... trying to find it in the tomcat/lib jars now. – AvaTaylor Sep 30 '20 at 15:51
  • I'm currently using the technique described here to ignore the exception: https://stackoverflow.com/questions/5158879/how-to-ignore-specific-type-of-uncaught-exception-in-eclipse – AvaTaylor Sep 30 '20 at 17:14

0 Answers0