"Tomcat" Tomcat error tracking

Source: Internet
Author: User
Tags apache tomcat

after the application deployment does not start properly, thetomcat boot log is as follows:

Information : Starting service Catalina

2015-7-22 18:39:31 org.apache.catalina.core.StandardEngine Start

Info : Starting Servlet engine:apache tomcat/6.0.36

2015-7-22 18:39:31 Org.apache.catalina.startup.HostConfig deploydirectory

Info : Deploying Web application Directory CDR

2015-7-22 18:39:31 Org.apache.catalina.loader.WebappClassLoader Validatejarfile

Info : 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

Severity : Error listenerstart

2015-7-22 18:39:34 org.apache.catalina.core.StandardContext Start

Severity : Context [/CDR] startup failed due to previous errors

2015-7-22 18:39:34 Org.apache.catalina.loader.WebappClassLoader Clearreferencesjdbc

Critical : 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 have been forcibly unregistered.

2015-7-22 18:39:34 Org.apache.catalina.loader.WebappClassLoader Clearreferencesjdbc

Critical : The Web application [/CDR] registered the JDBC driver [Com.mysql.jdbc.Driver] but failed-unregister it when the Web application was stopped. To prevent a memory leak, the JDBC Driver have been forcibly unregistered.

2015-7-22 18:39:34 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Filewatchdog] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 18:39:34 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-5] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 18:39:34 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-1] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 18:39:34 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-2] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 18:39:34 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-3] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 18:39:34 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-4] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 18:39:34 Org.apache.coyote.http11.Http11Protocol Start

Info : Starting Coyote http/1.1 on http-8080

2015-7-22 18:39:34 org.apache.jk.common.ChannelSocket Init

Information : jk:ajp13 listening on/0.0.0.0:9090

2015-7-22 18:39:34 Org.apache.jk.server.JkMain Start

Info : Jk running id=0 TIME=0/11 config=null

2015-7-22 18:39:34 Org.apache.catalina.startup.Catalina Start

Info : Server startup in 3280 Ms

Started to think it is a jar package conflict, delete javaee.jar package resolves the jar package conflict problem, start still error, log information as follows:

2015-7-22 19:34:23 org.apache.catalina.core.StandardService Start

Information : Starting service Catalina

2015-7-22 19:34:23 org.apache.catalina.core.StandardEngine Start

Info : Starting Servlet engine:apache tomcat/6.0.36

2015-7-22 19:34:23 Org.apache.catalina.startup.HostConfig deploydirectory

Info : Deploying Web application Directory CDR

2015-7-22 19:34:25 org.apache.catalina.core.StandardContext Start

Severity : Error listenerstart

2015-7-22 19:34:25 org.apache.catalina.core.StandardContext Start

Severity : Context [/CDR] startup failed due to previous errors

2015-7-22 19:34:25 Org.apache.catalina.loader.WebappClassLoader Clearreferencesjdbc

Critical : 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 have been forcibly unregistered.

2015-7-22 19:34:25 Org.apache.catalina.loader.WebappClassLoader Clearreferencesjdbc

Critical : The Web application [/CDR] registered the JDBC driver [Com.mysql.jdbc.Driver] but failed-unregister it when the Web application was stopped. To prevent a memory leak, the JDBC Driver have been forcibly unregistered.

2015-7-22 19:34:25 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Filewatchdog] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 19:34:25 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-5] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 19:34:25 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-1] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 19:34:25 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-2] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 19:34:25 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-3] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 19:34:25 Org.apache.catalina.loader.WebappClassLoader clearreferencesthreads

Critical : The Web application [/CDR] appears to had started a thread named [Thread-4] but had failed to stop it. This was very likely to create a memory leak.

2015-7-22 19:34:25 Org.apache.coyote.http11.Http11Protocol Start

Info : Starting Coyote http/1.1 on http-8080

2015-7-22 19:34:25 org.apache.jk.common.ChannelSocket Init

Information : jk:ajp13 listening on/0.0.0.0:9090

2015-7-22 19:34:25 Org.apache.jk.server.JkMain Start

Info : Jk running id=0 TIME=0/10 config=null

2015-7-22 19:34:25 Org.apache.catalina.startup.Catalina Start

Info : Server startup in 2639 Ms

This time the error can only see and JDBC have some relationship, the error is not obvious.

The following settings allow you to set up tracking for Tomcat and generate more detailed error reports:

Create a new file under the Web-inf/classes directory called logging.properties, which reads as follows:

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

This way, when we start Tomcat again, a more verbose log is generated in the logs directory error-debug.**.log

, and detailed error will be in the application's log output, through the settings, you can see the detailed errors are as follows:

......

# # # 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)

......

You can see that the reason that Tomcat did not start is due to the lack of table cdr.gg_alarm_contact_rin the database and the fact that the application started properly after recreating the table.

Summarize:

Tomcat itself starts with an error that may be ambiguous and may only prompt for error Listenerstart. In order to debug, we want to get a more detailed log, this time can be set by this method, so as to more effectively track the specific error.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"Tomcat" Tomcat error tracking

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.