[Tomcat]嚴重: Context [/xxxx] startup failed due to previous errors
1 tomcat 6600啟動報錯
[root@localhost webapps]# sh /usr/local/apache-tomcat-6.0.37_6600/bin/startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.37_6600
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.37_6600
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.37_6600/temp
Using JRE_HOME: /usr/java/jdk1.6.0_45
Using CLASSPATH: /usr/local/apache-tomcat-6.0.37_6600/bin/bootstrap.jar
Using CATALINA_PID: /var/tomcat/6600.pid
Existing PID file found during start.
Removing/clearing stale PID file.
看到/var/tomcat/6600.pid已經存在了,所以載入失敗。停止tomcat,然後檢查tomcat程式
2 刪除已經存在的6600.pid檔案
[root@localhost webapps]# ps -eaf|grep 6600
root 10446 4972 0 15:09 pts/2 00:00:00 grep 6600
[root@localhost webapps]# more /var/tomcat/6600.pid
10180
[root@localhost webapps]#
[root@localhost webapps]# ll /var/tomcat/6600.pid
-rw-r--r-- 1 root root 6 05-03 15:07 /var/tomcat/6600.pid
[root@localhost webapps]# rm -rf /var/tomcat/6600.pid
[root@localhost webapps]#
3 再重啟,還是報錯,檢視錯誤日誌如下:
tail -n 1000 /usr/local/apache-tomcat-6.0.37_6600/logs/catalina.out
2014-5-3 15:18:29 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
嚴重: The web application [/grouponAdminWeb] appears to have started a thread named [Thread-197] but has failed to stop it. This is very likely to create a memory leak.
2014-5-3 15:18:29 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
嚴重: The web application [/grouponAdminWeb] appears to have started a thread named [Thread-198] but has failed to stop it. This is very likely to create a memory leak.
......
2014-5-3 15:15:41 org.apache.catalina.startup.HostConfig deployWAR
資訊: Deploying web application archive grouponAdminWeb.war
SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also
2014-5-3 15:15:44 org.apache.catalina.core.StandardContext start
嚴重: Error listenerStart
2014-5-3 15:15:44 org.apache.catalina.core.StandardContext start
嚴重: Context [/grouponAdminWeb] startup failed due to previous errors
從這裡可以看出grouponAdminWeb這個web應用在tomcat容器上面deploy失敗,為什麼失敗?
4 分析為什麼會deploy應用失敗?
找這個應用的設計人員,經過同事提醒,去看同一目錄的localhost.2014-05-03.log檔案
tail -n 1000 /usr/local/apache-tomcat-6.0.37_6600/logs/localhost.2014-05-03.log
有如下錯誤提示:
2014-5-3 15:15:41 org.apache.catalina.core.StandardContext listenerStart
嚴重: 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: 'GrouponWeb.root' = [/usr/local/apache-tomcat-6.0.37_6600/webapps/grouponWeb/] instead of [/usr/local/apache-tomcat-6.0.37_6600/webapps/grouponAdminWeb/] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:148)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2014-5-3 15:15:41 org.apache.catalina.core.ApplicationContext log
資訊: Initializing Spring root WebApplicationContext
5 看到錯誤資訊,是配置檔案有誤,去修改WEB-INF下的web.xml
vim /usr/local/apache-tomcat-6.0.37_6600/webapps/grouponAdminWeb/WEB-INF/web.xml
將 GrouponWeb.root 的key值由GrouponWeb修改成GrouponAdminWeb,如下所示:
......
webAppRootKey
GrouponAdminWeb.root
......
之後重啟tomcat或者,重新載入GrouponAdminWeb應用,就OK了。
6 檢視最新tomcat啟動日誌如下
[root@localhost WEB-INF]# tail -n 200 /usr/local/apache-tomcat-6.0.37_6600/logs/catalina.out
資訊: Initializing Coyote HTTP/1.1 on http-6600
2014-5-3 15:18:53 org.apache.catalina.startup.Catalina load
資訊: Initialization processed in 472 ms
2014-5-3 15:18:53 org.apache.catalina.core.StandardService start
資訊: Starting service Catalina
2014-5-3 15:18:53 org.apache.catalina.core.StandardEngine start
資訊: Starting Servlet Engine: Apache Tomcat/6.0.37
2014-5-3 15:18:53 org.apache.catalina.startup.HostConfig deployDescriptor
資訊: Deploying configuration descriptor manager.xml
2014-5-3 15:18:53 org.apache.catalina.startup.HostConfig deployWAR
資訊: Deploying web application archive grouponWeb.war
SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also
============
2014-5-3 15:18:58 org.apache.catalina.startup.HostConfig deployWAR
資訊: Deploying web application archive grouponAdminWeb.war
SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also
============
2014-5-3 15:19:02 org.apache.catalina.startup.HostConfig deployWAR
資訊: Deploying web application archive grouponService.war
2014-5-3 15:19:04 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory ROOT
2014-5-3 15:19:04 org.apache.coyote.http11.Http11Protocol start
資訊: Starting Coyote HTTP/1.1 on http-6600
2014-5-3 15:19:04 org.apache.jk.common.ChannelSocket init
資訊: JK: ajp13 listening on /0.0.0.0:6609
2014-5-3 15:19:04 org.apache.jk.server.JkMain start
資訊: Jk running ID=0 time=0/13 config=null
2014-5-3 15:19:04 org.apache.catalina.startup.Catalina start
資訊: Server startup in 10955 ms
總結:tomcat容器的web應用載入報錯,除了要去看catalina.log日誌之外,還要去看localhost.2014-05-03.log日誌資訊。
[root@localhost webapps]# sh /usr/local/apache-tomcat-6.0.37_6600/bin/startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-6.0.37_6600
Using CATALINA_HOME: /usr/local/apache-tomcat-6.0.37_6600
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.37_6600/temp
Using JRE_HOME: /usr/java/jdk1.6.0_45
Using CLASSPATH: /usr/local/apache-tomcat-6.0.37_6600/bin/bootstrap.jar
Using CATALINA_PID: /var/tomcat/6600.pid
Existing PID file found during start.
Removing/clearing stale PID file.
看到/var/tomcat/6600.pid已經存在了,所以載入失敗。停止tomcat,然後檢查tomcat程式
2 刪除已經存在的6600.pid檔案
[root@localhost webapps]# ps -eaf|grep 6600
root 10446 4972 0 15:09 pts/2 00:00:00 grep 6600
[root@localhost webapps]# more /var/tomcat/6600.pid
10180
[root@localhost webapps]#
[root@localhost webapps]# ll /var/tomcat/6600.pid
-rw-r--r-- 1 root root 6 05-03 15:07 /var/tomcat/6600.pid
[root@localhost webapps]# rm -rf /var/tomcat/6600.pid
[root@localhost webapps]#
3 再重啟,還是報錯,檢視錯誤日誌如下:
tail -n 1000 /usr/local/apache-tomcat-6.0.37_6600/logs/catalina.out
2014-5-3 15:18:29 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
嚴重: The web application [/grouponAdminWeb] appears to have started a thread named [Thread-197] but has failed to stop it. This is very likely to create a memory leak.
2014-5-3 15:18:29 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
嚴重: The web application [/grouponAdminWeb] appears to have started a thread named [Thread-198] but has failed to stop it. This is very likely to create a memory leak.
......
2014-5-3 15:15:41 org.apache.catalina.startup.HostConfig deployWAR
資訊: Deploying web application archive grouponAdminWeb.war
SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also
2014-5-3 15:15:44 org.apache.catalina.core.StandardContext start
嚴重: Error listenerStart
2014-5-3 15:15:44 org.apache.catalina.core.StandardContext start
嚴重: Context [/grouponAdminWeb] startup failed due to previous errors
從這裡可以看出grouponAdminWeb這個web應用在tomcat容器上面deploy失敗,為什麼失敗?
4 分析為什麼會deploy應用失敗?
找這個應用的設計人員,經過同事提醒,去看同一目錄的localhost.2014-05-03.log檔案
tail -n 1000 /usr/local/apache-tomcat-6.0.37_6600/logs/localhost.2014-05-03.log
有如下錯誤提示:
2014-5-3 15:15:41 org.apache.catalina.core.StandardContext listenerStart
嚴重: 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: 'GrouponWeb.root' = [/usr/local/apache-tomcat-6.0.37_6600/webapps/grouponWeb/] instead of [/usr/local/apache-tomcat-6.0.37_6600/webapps/grouponAdminWeb/] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:148)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2014-5-3 15:15:41 org.apache.catalina.core.ApplicationContext log
資訊: Initializing Spring root WebApplicationContext
5 看到錯誤資訊,是配置檔案有誤,去修改WEB-INF下的web.xml
vim /usr/local/apache-tomcat-6.0.37_6600/webapps/grouponAdminWeb/WEB-INF/web.xml
將 GrouponWeb.root 的key值由GrouponWeb修改成GrouponAdminWeb,如下所示:
......
......
之後重啟tomcat或者,重新載入GrouponAdminWeb應用,就OK了。
6 檢視最新tomcat啟動日誌如下
[root@localhost WEB-INF]# tail -n 200 /usr/local/apache-tomcat-6.0.37_6600/logs/catalina.out
資訊: Initializing Coyote HTTP/1.1 on http-6600
2014-5-3 15:18:53 org.apache.catalina.startup.Catalina load
資訊: Initialization processed in 472 ms
2014-5-3 15:18:53 org.apache.catalina.core.StandardService start
資訊: Starting service Catalina
2014-5-3 15:18:53 org.apache.catalina.core.StandardEngine start
資訊: Starting Servlet Engine: Apache Tomcat/6.0.37
2014-5-3 15:18:53 org.apache.catalina.startup.HostConfig deployDescriptor
資訊: Deploying configuration descriptor manager.xml
2014-5-3 15:18:53 org.apache.catalina.startup.HostConfig deployWAR
資訊: Deploying web application archive grouponWeb.war
SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also
============
2014-5-3 15:18:58 org.apache.catalina.startup.HostConfig deployWAR
資訊: Deploying web application archive grouponAdminWeb.war
SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also
============
2014-5-3 15:19:02 org.apache.catalina.startup.HostConfig deployWAR
資訊: Deploying web application archive grouponService.war
2014-5-3 15:19:04 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory ROOT
2014-5-3 15:19:04 org.apache.coyote.http11.Http11Protocol start
資訊: Starting Coyote HTTP/1.1 on http-6600
2014-5-3 15:19:04 org.apache.jk.common.ChannelSocket init
資訊: JK: ajp13 listening on /0.0.0.0:6609
2014-5-3 15:19:04 org.apache.jk.server.JkMain start
資訊: Jk running ID=0 time=0/13 config=null
2014-5-3 15:19:04 org.apache.catalina.startup.Catalina start
資訊: Server startup in 10955 ms
總結:tomcat容器的web應用載入報錯,除了要去看catalina.log日誌之外,還要去看localhost.2014-05-03.log日誌資訊。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26230597/viewspace-1153074/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- tar解壓報錯——Not found in archive tar: Exiting with failure status due to previous errorsHiveAIError
- PostgreSQL cache lookup failed for type XXXX 錯誤SQLAI
- FATAL - Fatal error: Target Interaction Manager failed at StartupErrorAI
- NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load xxxx錯誤解決方法ErrorAIXMLHTTP
- CRS-4124: Oracle High Availability Services startup failed.OracleAI
- Vue 啟動專案報錯 Failed to compile with 2 errorsVueAICompileError
- vertica單節點故障恢復 Startup Failed, ASR RequiredAIUI
- 嚴重: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"] java.lang.NullPointAIProtocolJavaNull
- PostgreSQL Detail: Failed on request of size 8192 in memory context "ErrorContexSQLAIContextError
- tomcat-啟動報錯Multiple Contexts have a path of "/xxxx"TomcatContext
- 啟動tomcat中的startup.bat閃退原因TomcatBAT
- mongoengine.errors.OperationError: Update failed (BSON field ‘no_cursor_timeout‘ is an unknown fieldGoErrorAI
- tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] namePythonFrameworkErrorAI
- CRS-4124: Oracle High Availability Services startup failed. CRS-4000OracleAI
- Android執行出現android Installation failed due to invalid URI! 錯誤處理AndroidAI
- 記錄Windows failed fast startup with error status 0xC00000D4.WindowsAIASTError
- Mac 終端配置Tomcat提示bash: tomcat8.0.39/bin/startup.sh: 許可權不夠MacTomcat
- startup,startup mount,startup nomount之間的區別
- Server Tomcat v9.0 Server at localhost failed to start.ServerTomcatlocalhostAI
- 計算機史上最嚴重漏洞被公開,風險等級嚴重計算機
- 在Linux上啟動Tomcat,結果彈出:-bash: ./startup.sh: Permission deniedLinuxTomcat
- DDOS的危害日趨嚴重
- The Tomcat connector configured to listen on port 80 failed to start. The port may already be inTomcatAI
- startup nomount
- The fundamental idea remains the same as previous yearsIdeaREMAI
- Linux上監控Tomcat Down掉後自動重啟TomcatLinuxTomcat
- win10卡頓嚴重怎麼解決 win10卡頓嚴重的解決方法Win10
- 談談BUG嚴重級別(severity)管理
- 思科IP電話存嚴重RCE漏洞!
- 谷歌稱macOS核心存在“嚴重”漏洞谷歌Mac
- Go:context.ContextGoContext
- centos 重啟掛載錯誤 failed to mount /backupCentOSAI
- 解決nacos報錯 Caused by: io.grpc.netty.shaded.io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: 地址已在使用RPCNettyErrorExceptionAI
- Working with Errors in Go 1.13ErrorGo
- Go Errors 詳解GoError
- slave-skip-errorsError
- 報錯xxxx of undefinedUndefined
- 寫一條一行的4為數字,每隔4個數字空一格 xxxx xxxx xxxx xxx就是xxxx這樣的格式
- 【Azure API 管理】解決API Management新增AAD Group時遇見的 Failed to query Azure Active Directory graph due to error 錯誤APIAIError