简体   繁体   English

如何在tomcat中修复java.lang.NoClassDefFoundError

[英]How to fix java.lang.NoClassDefFoundError in tomcat

I'm getting below error message often and due to this error I'm suspecting my application creating outofMemory Error in permGen space. 我经常收到以下错误消息,由于该错误,我怀疑我的应用程序在permGen空间中创建了outofMemory错误。

Can someone help how to fix the below exception. 有人可以帮助您解决以下异常。

I'm using pure servlet and tomcat 7. 我正在使用纯servlet和tomcat 7。

INFO: Illegal access: this web application instance has been stopped already.  Could not load com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.  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.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1745)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)
    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)

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: com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1854)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)
    ... 5 more

That message just occurs because the web application is still trying to load things after you have shut it down. 之所以会出现该消息,是因为Web应用程序在关闭后仍在尝试加载内容。

As such, it should not have "business impact" (you don't care about errors in an app that you shut down), especially if it happens in the process of shutting down the whole app server. 这样,它就不会产生“业务影响”(您不必担心关闭的应用程序中的错误),尤其是在关闭整个应用程序服务器的过程中发生错误时。

You may want to figure out why it does not shutdown more cleanly (maybe some background processing that needs to be stopped when the webapp is asked to terminate). 您可能想要弄清楚为什么它不能更彻底地关闭(也许某些后台处理需要在终止webapp时停止)。 If there is stuff still going on in there, that might cause problems for any other web apps still running. 如果仍然有东西在运行,则可能会导致其他任何仍在运行的Web应用程序出现问题。

If you did not intend to shut down the webapp, then there is probably another error earlier in the log. 如果您不打算关闭该Web应用程序,则日志中较早的地方可能还有另一个错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM