org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access

关于一个HTTP头验证出错的问题,受点拨于一位大佬的刨根问底。org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access
原链接为:https://blog.csdn.net/zl544434558/article/details/49095591

13-Oct-2015 08:26:56.061 INFO [service%0043ache.data] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [net.sf.ehcache.store.disk.Segment$1]. 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 [net.sf.ehcache.store.disk.Segment$1]. 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:1335)
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1321)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1203)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1164)
    at net.sf.ehcache.store.disk.Segment$HashIterator.(Segment.java:997)
    at net.sf.ehcache.store.disk.Segment.hashIterator(Segment.java:948)
    at net.sf.ehcache.store.disk.DiskStore$HashIterator.(DiskStore.java:999)
    at net.sf.ehcache.store.disk.DiskStore$KeyIterator.(DiskStore.java:1072)
    at net.sf.ehcache.store.disk.DiskStore$KeyIterator.(DiskStore.java:1072)
    at net.sf.ehcache.store.disk.DiskStore$KeySet.iterator(DiskStore.java:910)
    at net.sf.ehcache.store.disk.DiskStorageFactory$DiskExpiryTask.run(DiskStorageFactory.java:828)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

此处产生问题的原因是:一个tomcat启动了两个进程。

为什么会产生两个进程呢? 在网上找了一大堆资料后,大致说法如下: 1、sh shutdown.sh
不能完全杀死tomcat或者是不能立马杀死tomcat
2、tomcat的con/server.xml中的context属性reloadable默认为true导致。

由于windows环境下,Tomcat被占用是会自动弹窗报错的,此时若关掉窗口在重启tomcat是可以再运行项目的,但由此就会引发这个一个tomcat开两个进程的问题,进而导致URL出错等问题。

解决方法是:关掉占用端口的进程即可。
输入cmd进入命令管理:
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access_第1张图片
输入netstat -ano找到你的tomcat端口号(一般为8080或8009)的PID号,
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access_第2张图片
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access_第3张图片
再进入任务管理器,找到占用端口的进程,结束该进程后重启tomcat运行项目即可。
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access_第4张图片

你可能感兴趣的:(笔记,JavaWeb)