tomcat報錯:org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already.
關於一個HTTP頭驗證出錯的問題:
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [META-INF/services/javax.xml.stream.XMLInputFactory]. 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 [META-INF/services/javax.xml.stream.XMLInputFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
意思是:
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading非法訪問:此web應用程序實例已停止。無法加載[META-INF/services/javax.xml.stream.XMLInputFactory]。為了調試以及終止導致非法訪問的線程,將拋出以下堆棧跟蹤。
java.lang.IllegalStateException:非法訪問:此web應用程序實例已停止。無法加載[META-INF/services/javax.xml.stream.XMLInputFactory]。為了調試以及終止導致非法訪問的線程,將拋出以下堆棧跟蹤。
此處產生問題的原因是:一個tomcat啟動了兩個進程。
為什么會產生兩個進程呢? 在網上找了一大堆資料后,大致說法如下:
1、sh shutdown.sh
不能完全殺死tomcat或者是不能立馬殺死tomcat
2、tomcat的con/server.xml中的context屬性reloadable默認為true導致。
由於windows環境下,Tomcat被占用是會自動彈窗報錯的,此時若關掉窗口在重啟tomcat是可以再運行項目的,但由此就會引發這個一個tomcat開兩個進程的問題,進而導致URL出錯等問題。
解決方法是:關掉占用端口的進程即可。