this web application instance has been stopped already異常

tomcat下啟動(dòng)多個(gè)應(yīng)用時(shí)可能遇到的異常:

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff; min-height: 13.0px}span.s1 {font-variant-ligatures: no-common-ligatures}span.Apple-tab-span {white-space:pre}

INFO: Starting ProtocolHandler ["ajp-bio-9009"]
Oct 25, 2016 10:00:26 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 14612 ms
Oct 25, 2016 10:00:27 PM org.apache.catalina.loader.WebappClassLoaderBase loadClass
INFO: Illegal access: this web application instance has been stopped already.  Could not load org.springframework.core.NestedExceptionUtils.  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.
java.lang.IllegalStateException
 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1745)
 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)
 at org.springframework.core.NestedRuntimeException.<clinit>(NestedRuntimeException.java:45)
 at org.springframework.scheduling.quartz.SchedulerFactoryBean$1.run(SchedulerFactoryBean.java:672)

Exception in thread "Quartz Scheduler [scheduler]" java.lang.NoClassDefFoundError: org/springframework/core/NestedExceptionUtils
 at org.springframework.core.NestedRuntimeException.<clinit>(NestedRuntimeException.java:45)
 at org.springframework.scheduling.quartz.SchedulerFactoryBean$1.run(SchedulerFactoryBean.java:672)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.NestedExceptionUtils
 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1854)
 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1703)
 ... 2 more

原因

看日志以為是“com.xxx.xxx.xxxxxxx”類(lèi)加載異常,其實(shí)這個(gè)只是現(xiàn)象,不不是真正引起問(wèn)題的原因。
看這個(gè)真正的異常原因需要看tomcat/logs/localhost.年-月-日.log的文件,這個(gè)文件中會(huì)描述正真的錯(cuò)誤原因。

tomcat/logs/localhost.年-月-日.log`的文件

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}span.s1 {font-variant-ligatures: no-common-ligatures}span.Apple-tab-span {white-space:pre}

Oct 25, 2016 5:00:54 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [/home/vhsworkdic/zicai/webapps/cbsService/] instead of [/home/vhsworkdic/zicai/webapps/zicai/] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
 at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:151)
 at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:116)
 at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
 at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1960)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)

從日志文件可以看出是說(shuō)Web應(yīng)用程序根系統(tǒng)屬性已經(jīng)被設(shè)置,'webapp.root' 這個(gè)配置名稱(chēng)已經(jīng)被使用,提示了Choose unique values for the 'webAppRootKey' context-param in your web.xml files ,也就是說(shuō)在web.xml里配置一個(gè)唯一的'webAppRootKey' ,這樣就不會(huì)發(fā)生沖突。

解決辦法

web.xml指定webAppRootKey

<context-param>  
    <param-name>webAppRootKey</param-name>  
    <param-value>myapp.root</param-value>  
</context-param>  
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Spring Boot 參考指南 介紹 轉(zhuǎn)載自:https://www.gitbook.com/book/qbgb...
    毛宇鵬閱讀 47,288評(píng)論 6 342
  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,695評(píng)論 19 139
  • 從三月份找實(shí)習(xí)到現(xiàn)在,面了一些公司,掛了不少,但最終還是拿到小米、百度、阿里、京東、新浪、CVTE、樂(lè)視家的研發(fā)崗...
    時(shí)芥藍(lán)閱讀 42,881評(píng)論 11 349
  • 1. Java基礎(chǔ)部分 基礎(chǔ)部分的順序:基本語(yǔ)法,類(lèi)相關(guān)的語(yǔ)法,內(nèi)部類(lèi)的語(yǔ)法,繼承相關(guān)的語(yǔ)法,異常的語(yǔ)法,線(xiàn)程的語(yǔ)...
    子非魚(yú)_t_閱讀 34,853評(píng)論 18 399
  • 別以為粉色只適合浪漫的春天,其實(shí),它更加適合溫暖寒冷的冬天。這是一個(gè)溫柔的色彩,充滿(mǎn)了濃郁的女性氣息,如果你覺(jué)得這...
    教你穿衣打扮閱讀 787評(píng)論 0 0

友情鏈接更多精彩內(nèi)容