在做集成测试环境的时候,需要利用TOmcat的start.bat来启动和shutdown.bat来关闭Tomat应用服务器,但是发现利用shutdown.bat关闭的是,java进程关闭了,但是Tomcat的启动窗口没有关闭,窗口中有报错信息,如下:
信息: Illegal access: this web application instance has been stopped already (th
e eventual following stack trace is caused by an error thrown for debugging purp
oses as well as to attempt to terminate the thread which caused the illegal acce
ss, and has no functional impact)
2012-2-15 23:10:15 org.apache.catalina.loader.WebappClassLoader loadClass
信息: Illegal access: this web application instance has been stopped already (th
e eventual following stack trace is caused by an error thrown for debugging purp
oses as well as to attempt to terminate the thread which caused the illegal acce
ss, and has no functional impact)
Exception in thread "DefaultQuartzScheduler_QuartzSchedulerThread" org.apache.co
mmons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigura
tionException: java.lang.ThreadDeath (Caused by java.lang.ThreadDeath) (Caused b
y org.apache.commons.logging.LogConfigurationException: java.lang.ThreadDeath (C
aused by java.lang.ThreadDeath))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.quartz.core.QuartzSchedulerThread.getLog(QuartzSchedulerThread.ja
va:475)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:
404)
Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.Threa
dDeath (Caused by java.lang.ThreadDeath)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
actoryImpl.java:397)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:529)
... 5 more
Caused by: java.lang.ThreadDeath
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1229)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1189)
at org.apache.commons.logging.impl.LogFactoryImpl$1.run(LogFactoryImpl.j
ava:441)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.impl.LogFactoryImpl.loadClass(LogFactoryIm
pl.java:435)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
actoryImpl.java:376)
... 6 more
产生该问题的原因是关闭Tomcat的时候,Tomcat没有关闭完所有启动的线程,只需要按照异常信息,解决掉异常信息后,Tomcat窗口就可以关闭了。
这里的原因是因为我们使用Quarter来管理任务调度,但是在启动Quarter的时候,有一个定时任务对应的类不存在,导致该线程一直在占用,导致利用shutdown.bat也无法关闭,只需要删除掉出错的调度任务,就可以利用shutdown.bat来关闭Tomcat窗口了。