为什么Eclipse调试会抱怨ClassNotFound?

问题描述

我有一个在Eclipse中运行的Java / Spring MVC Web应用程序。

应用程序运行正常。

但是,Eclipse调试器每隔几分钟就会跳转到类Timer.class的一部分,并且会出现以下错误...

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

...,否则应用程序可以正常运行。

为什么Eclipse调试会抱怨ClassNotFound?

此处有完整的堆栈跟踪:

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)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)