java異常之 Could not load net.sf.ehcache.store.disk.DiskStore$KeySet....
阿新 • • 發佈:2019-02-05
在重啟tomcat的時候出現此異常,但是不影響正常功能。
異常程式碼:
資訊: Illegal access: this web application instance has been stopped already. Could not load net.sf.ehcache.store.disk.DiskStore$KeySet. 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:1776) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734) at net.sf.ehcache.store.disk.DiskStore.keySet(DiskStore.java:521) at net.sf.ehcache.store.disk.DiskStorageFactory$DiskExpiryTask.run(DiskStorageFactory.java:828) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
異常分析:反覆頻繁的重啟tomcat導致上一個tomat中的執行緒沒有正常關閉。
解決辦法:
將tomcat中的server.xml中的reloadable由原來的true改為false。
設定reloadable="true"後,tomcat會實時的監控專案的原始碼,一旦出現改動會自己重啟tomcat伺服器。在除錯程式的時候一般都不會設定relaodable="true",頻繁的重啟tomcat是不合理的。如果你設定了reloadable="false",或者沒有設定這個屬性,只有當你在新增,刪除,重新命名方法或例項欄位的時候才要求服務重啟,適合你除錯程式。