在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java  Linux/ Tomcat啟動(dòng)Spring-boot應(yīng)用關(guān)閉時(shí)報(bào)錯(cuò)但Application啟動(dòng)

Tomcat啟動(dòng)Spring-boot應(yīng)用關(guān)閉時(shí)報(bào)錯(cuò)但Application啟動(dòng)應(yīng)用關(guān)閉時(shí)卻正常

Spring boot 2.0工程 使用了quartz來執(zhí)行定時(shí)任務(wù), 當(dāng)在IDEA中通過執(zhí)行Application類來運(yùn)行的時(shí)候 可以正常關(guān)閉應(yīng)用。但是將該應(yīng)用部署到Tomcat中的時(shí)候 關(guān)閉Tomcat的時(shí)候卻報(bào)了下面的錯(cuò)誤

13-Feb-2018 17:03:30.768 INFO [scheduler_Worker-1] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [ch.qos.logback.core.status.WarnStatus]. 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 [ch.qos.logback.core.status.WarnStatus]. 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:1305)

Exception in thread "scheduler_Worker-1" java.lang.NoClassDefFoundError: ch/qos/logback/core/status/WarnStatus
    at ch.qos.logback.classic.LoggerContext.noAppenderDefinedWarning(LoggerContext.java:186)
    at ch.qos.logback.classic.Logger.callAppenders(Logger.java:264)
    at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:421)
    at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
    at ch.qos.logback.classic.Logger.debug(Logger.java:482)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:612)
    

在SimpleThreadPool 612行中加了斷點(diǎn) 但關(guān)閉Tomcat的時(shí)候并沒有進(jìn)入該斷點(diǎn)

getLog().debug("WorkerThread is shut down.");

現(xiàn)在很困惑 感覺無從下手

  • 同樣的代碼通過Application類啟動(dòng)的話 可以正常關(guān)閉 但是通過Tomcat來啟動(dòng)的話 關(guān)閉Tomcat的時(shí)候 就有了額外的報(bào)錯(cuò)信息 是Tomcat做了什么額外的工作嗎 還是通過Application類啟動(dòng)的話會(huì)先結(jié)束scheduler_Worker-1再結(jié)束主線程嗎 但Tomcat就沒有這個(gè)順序
  • 為什么加了斷點(diǎn) 也不會(huì)進(jìn)入呢 這樣的話 都不知道該怎么調(diào)試
回答
編輯回答
汐顏

是不是應(yīng)用停了quartz沒停,可以設(shè)置一個(gè)application exit https://docs.spring.io/spring... 試試看

2017年7月23日 22:22
編輯回答
陌顏

看你的log輸出是缺少了jar包,

java.lang.NoClassDefFoundError: ch/qos/logback/core/status/WarnStatus

2018年9月4日 01:15