【Tomcat】Tomcat报错追踪
应用部署上之后无法正常启动。tomcat启动日志例如以下:
信息: Starting service Catalina
2015-7-22 18:39:31 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.36
2015-7-22 18:39:31 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory cdr
2015-7-22 18:39:31 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(/cdr/webserver/CDR2.0/webapps/cdr/WEB-INF/lib/javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2015-7-22 18:39:34 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2015-7-22 18:39:34 org.apache.catalina.core.StandardContext start
严重: Context [/cdr] startup failed due to previous errors
2015-7-22 18:39:34 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/cdr] registered the JDBC driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2015-7-22 18:39:34 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/cdr] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2015-7-22 18:39:34 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [FileWatchdog] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 18:39:34 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-5] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 18:39:34 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-1] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 18:39:34 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-2] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 18:39:34 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-3] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 18:39:34 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-4] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 18:39:34 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2015-7-22 18:39:34 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:9090
2015-7-22 18:39:34 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/11 config=null
2015-7-22 18:39:34 org.apache.catalina.startup.Catalina start
信息: Server startup in 3280 ms
開始以为是jar包冲突,删除javaee.jar包攻克了jar包冲突问题,启动依旧报错,日志信息例如以下:
2015-7-22 19:34:23 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2015-7-22 19:34:23 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.36
2015-7-22 19:34:23 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory cdr
2015-7-22 19:34:25 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2015-7-22 19:34:25 org.apache.catalina.core.StandardContext start
严重: Context [/cdr] startup failed due to previous errors
2015-7-22 19:34:25 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/cdr] registered the JDBC driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2015-7-22 19:34:25 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/cdr] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2015-7-22 19:34:25 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [FileWatchdog] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 19:34:25 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-5] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 19:34:25 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-1] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 19:34:25 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-2] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 19:34:25 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-3] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 19:34:25 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/cdr] appears to have started a thread named [Thread-4] but has failed to stop it. This is very likely to create a memory leak.
2015-7-22 19:34:25 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2015-7-22 19:34:25 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:9090
2015-7-22 19:34:25 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/10 config=null
2015-7-22 19:34:25 org.apache.catalina.startup.Catalina start
信息: Server startup in 2639 ms
这时候报错仅仅能看到和JDBC有一些关系,报错不明显。
通过下面设置能够设置对于Tomcat的追踪。生成更为具体的错误报告:
在WEB-INF/classes文件夹下新建一个文件叫logging.properties,内容例如以下:
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
org.apache.juli.FileHandler.level = FINE
org.apache.juli.FileHandler.directory = ${catalina.base}/logs
org.apache.juli.FileHandler.prefix = error-debug.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
这样,我们再启动tomcat时,就会在logs文件夹下生成一个更具体的日志error-debug.**.log
,而且具体报错也会在应用的日志中输出出来。通过该种设置,能够看到的具体错误例如以下:
......
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'cdr.gg_alarm_contact_r' doesn't exist
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'cdr.gg_alarm_contact_r' doesn't exist
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'cdr.gg_alarm_contact_r' doesn't exist
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
......
能够看到真正导致Tomcat无法启动的原因是因为数据库中缺乏表cdr.gg_alarm_contact_r,又一次创建该表后应用启动正常。
总结:
Tomcat本身启动的报错可能都比較含糊,可能仅仅提示了Error listenerStart。为了调试,我们要获得更具体的日志。这时候就能够通过这样的方法进行设置。从而更有效的追踪具体的报错。
【Tomcat】Tomcat报错追踪的更多相关文章
- Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误——SHH框架
SHH框架工程,Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误 1.查看配置文件web.xml中是否配置.or ...
- 启动Tomcat服务器报错
启动Tomcat服务器报错: Several ports (8005, 8080, 8009) required by Tomcat v5.5 Server at localhost are alre ...
- tomcat启动报错Several ports (8080, 8009) required by Tomcat v6.0
tomcat启动报错 如下图: 问题:8080.8009端口已经被占用. 解决办法: 1.在命令提示符下,输入netstat -aon | findstr 8080 2.继续输入taskkill -F ...
- tomcat启动报错
[toc]启动错误 does not exist or is not a readable directory 问题:tomcat启动报错:does not exist or is not a rea ...
- [转]tomcat启动报错too low setting for -Xss
tomcat启动报错too low setting for -Xss 网上给的答案都是调整Xss参数,其实不是正确的做法, -Xss:每个线程的Stack大小,“-Xss 15120” 这使得tomc ...
- tomcat启动报错 ERROR o.a.catalina.session.StandardManager 182 - Exception loading sessions from persiste
系统:centos6.5 x86_64 jdk: 1.8.0_102 tomcat:8.0.37 tomcat 启动报错: ERROR o.a.catalina.session.StandardMan ...
- linux 下 tomcat 运行报错 Broken pipe
linux 下 tomcat 运行报错 Broken pipe 感谢:http://hi.baidu.com/liupenglover/blog/item/4048c23ff19f1cd67d1e71 ...
- Tomcat启动报错:[The configuration may be corrupt or incomplete]的解决方案
1,场景说明: 偶然碰见Tomcat启动报错,此时并没有Add任何Web项目: Could not load the Tomcat server configuration at /Servers/T ...
- tomcat启动报错:Injection of autowired dependencies failed
tomcat启动报错:Injectjion of autowired dependencies failed 环境: 操作系统:centos6.5 tomcat: 7.0.52 jdk:openjdk ...
- 单点登录(五)-----遇到问题-----cas server 源码部署tomcat运行报错BeanCreationException:Error creating bean with name 's
我们在上一篇文章已经解决了把下载好的cas server源码部署到tomcat缺少子项目编辑文件或者jar包导致找不到class报错的问题 单点登录(四)-----遇到问题-----cas serve ...
随机推荐
- Java中用Scanner扫描控制台输入时的一个小问题
package com.hxl; import java.util.Scanner; public class Test { public static void main(String[] args ...
- 054 kafka内部机制
一:数据格式与数据存储 1.总结 存储在磁盘文件中(index+log) 顺序读写的 基于offset偏移量来管理数据的(主要是读操作) 由分区器根据key值决定数据分布到哪个分区,默认使用hash ...
- CodeSignal 刷题 —— almostIncreasingSequence
Given a sequence of integers as an array, determine whether it is possible to obtain a strictly incr ...
- Python编程基础[条件语句if 循环语句 for,while](二)
ython条件语句是通过一条或多条语句的执行结果(True或者False)来决定执行的代码块. 可以通过下图来简单了解条件语句的执行过程: if 判断条件: 执行语句……else: 执行语句…… x= ...
- js(javaScript)的各种事件触发,以常见为主eg:onclick
js的各种事件触发,以常见为主eg:onclick1.onclick,点击后触发事件 (1)<h1 onclick="this.innerHTML='谢谢!'">请点击 ...
- hdu1285 确定比赛名次【拓扑排序】
题目链接 确定比赛名次 Time Limit: 2000/1000 MS (Java/Others) Memory ...
- Is there a TRY CATCH command in Bash
Is there a TRY CATCH command in Bash? No. Bash doesn't have as many luxuries as one can find in many ...
- linux基础权限管理
1.linux系统中的文件类型:- 一般文件 存放数据d 目录文件 存放其他文件l 链接文件 类似于windows系统中的快捷方式b 区块设备文件 可以随时读取c 字符设备文件 需要顺序读 ...
- PAT (Advanced Level) Practise 1002 解题报告
GitHub markdownPDF 问题描述 解题思路 代码 提交记录 问题描述 A+B for Polynomials (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 ...
- php文件及文件夹操作(创建、删除、移动、复制)
<?php /** * 操纵文件类 * * 例子: * FileUtil::createDir('a/1/2/3'); 测试建立文件夹 建一个a/1/2/3文件夹 * FileUtil::cre ...