一、問題描述
Apr 20, 2017 8:49:24 AM org.apache.catalina.loader.WebappClassLoaderBase findResourceInternal
INFO: Illegal access: this web application instance has been stopped already. Could not load oracle/sql/converter_xcharset/lx20354.glb. 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.
Apr 20, 2017 8:49:31 AM org.apache.catalina.loader.WebappClassLoaderBase findResourceInternal
INFO: Illegal access: this web application instance has been stopped already. Could not load oracle/sql/converter_xcharset/lx20354.glb. 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.
Apr 20, 2017 8:49:34 AM org.apache.catalina.loader.WebappClassLoaderBase findResourceInternal
INFO: Illegal access: this web application instance has been stopped already. Could not load oracle/sql/converter_xcharset/lx20354.glb. 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.
這個(gè)問題只是在日志文件中出現(xiàn),但并不影響tomcat的訪問,一樣是可以用的。只是這個(gè)問題不斷的在日志中打印,看著不爽或者也會(huì)導(dǎo)致其它未知的問題。
二、解決方案
方法一:
原因是因?yàn)樵趖omcat重啟的時(shí)候,之前的tomcat的線程還沒有完全關(guān)閉,最新啟動(dòng)tomcat就會(huì)報(bào)這個(gè)異常。
針對(duì)這種情況,在網(wǎng)上找了些原因
Java代碼 收藏代碼
運(yùn)行tomcat/bin/shutdown.sh,tomcat停止,但它的java進(jìn)程還在,事不過狀態(tài)為S(sleep),不是運(yùn)行時(shí)的R(Runnable),如果不kill的話,這種進(jìn)程越來越多
不過暫時(shí)未驗(yàn)證。
解決方法是重啟Tomcat和Apache服務(wù)器,我把整個(gè)Linux服務(wù)器重啟后就可以了正常使用,現(xiàn)做個(gè)記錄,后面驗(yàn)證。同時(shí)也可以清除tomcat的臨時(shí)目錄(如:D:\tomcat-7.0.63\work\Catalina),避免文件沖突問題。
方法二:
避免這種錯(cuò)誤另一種做法,就是修改tomcat下conf/server.xml文件,把host節(jié)點(diǎn)中context中的reloadable修改為false,如:
把
<Context path="" docBase="/home/java/tomcat7/webapps/finance" debug="0" reloadable="true"/>
改成
<Context path="" docBase="/home/java/tomcat7/webapps/finance" debug="0" reloadable="false"/>
但是這樣做會(huì)失去熱部署的優(yōu)勢(shì),而且對(duì)于開發(fā)也不是很方便,建議不要用這種方式。
熱門工具 換一換