Illegal access: this web application instance has been stopped already. Could not load com.net.paoding.analysis.dictionary.supp

来源:互联网 发布:软件photocard 编辑:程序博客网 时间:2024/06/08 04:10

 信息: Illegal access: this web application instance has been stopped already.  Could not load com.net.paoding.analysis.dictionary.support.detection.Difference.  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:1246)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
 at java.lang.ClassLoader.loadClassInternal(Unknown Source)
 at com.net.paoding.analysis.dictionary.support.detection.Snapshot.diff(Snapshot.java:118)
 at com.net.paoding.analysis.dictionary.support.detection.Detector.forceDetecting(Detector.java:111)
 at com.net.paoding.analysis.dictionary.support.detection.Detector.run(Detector.java:105)
 at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-3" java.lang.NoClassDefFoundError: com/net/paoding/analysis/dictionary/support/detection/Difference
 at com.net.paoding.analysis.dictionary.support.detection.Snapshot.diff(Snapshot.java:118)
 at com.net.paoding.analysis.dictionary.support.detection.Detector.forceDetecting(Detector.java:111)
 at com.net.paoding.analysis.dictionary.support.detection.Detector.run(Detector.java:105)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.net.paoding.analysis.dictionary.support.detection.Difference
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
 at java.lang.ClassLoader.loadClassInternal(Unknown Source)
 ... 4 more
网上找到的解释:
Question: What causes these frequent Tomcat catalina.log messages "INFO: Illegal access: this web application instance has been stopped already."? I do not want to disable INFO level logging, so it would be nice to stop the root of the problem. I tried disabling RSS and Lucence and they still keep coming out. The full log entry looks like this: May 8, 2005 9:34:09 PM org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load org.xml.sax.helpers.XMLReaderFactory. 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.

A:I found this explanation from web: It is possible that this is caused by Tomcat unsuccessfully reloading the web application. The app is unloaded, but all threads don't get shut down properly. As a result, when the threads try to run, they get clobbered by the fact that Tomcat has shut down its classloader, and an error is logged. The best fix is to turn off automatic webapp reloading for the application: in Tomcat's server.xml , find the <Context> declaration, and ensure it is set to: reloadable="false"

翻译一下上面的分析及解决方法:
原因:tomcat重新装载web应用程序失败导致的。当应用程序卸载时,并不会关闭所有的线程。当tomcat已经关闭了其类加载器后,一些线程依然会继续运行,这样就导致出错,这些错误就会被到日志文件里。
解决方法是:修改tomcat目录下conf文件夹下的server.xml,找到<Context>标签,把reloadble的属性值设为:reloadable="false"

自从把庖丁解牛分词器从1.*版本换为2.0.4版本就出现这个问题,但是在开发过程中reloadable设为"false"也不是一个完美的解决方法,不知还有没有其他方法来解决这个问题,如在程序中监听之类然后做处理?

原创粉丝点击