Record the tomcat troubleshooting process

Source: Internet
Author: User

Phenomenon Environment Description: test environment, has been running across the Yida system (business system), research and development re-issued a war package, will not be able to access, submitted to the OPS side said it is environmental issues, so I began to troubleshoot.


1, java_home, catalina_home inspection

[Email protected] conf]# echo $JAVA _home

/usr/local/jdk1.7.0_60

2, check Server.xml

<context path= "" docbase= "/usr/local/oss/greenpass/wtpwebapp/greenpass" debug= "0" crosscontext= "true" reloadable = "true" trusted= "false"/>

Check the modified site root directory, no problem

Browser access prompt, Web page does not exist

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/80/71/wKioL1dCYdiwCMefAABPnaaJjpA960.png "title=" 1.png " alt= "Wkiol1dcydiwcmefaabpnaajjpa960.png"/>

Curl Tip 404

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/80/71/wKioL1dCY3bDdKOJAAAZrvGSVOg118.png "title=" 2.png " alt= "Wkiol1dcy3bddkojaaazrvgsvog118.png"/>

It is strange that the program code is clearly placed in the root directory, how can not find it!

3. View Logs

Tail-f Catalina.out, reboot tomcat and prompt for log errors as follows:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/80/71/wKioL1dCZyPDKndEAACV61JXgkQ138.png "title=" 4.png " alt= "Wkiol1dczypdkndeaacv61jxgkq138.png"/> There are some errors and warnings, mainly:

November 23, 2013 7:21:58 pm Org.apache.catalina.core.StandardContext startinternal

Server:error Filterstart

November 23, 2013 7:21:58 pm Org.apache.catalina.core.StandardContext startinternal

Server:context [/ST] startup failed due to previous errors

4. Analysis of Causes and solutions

Analysis: The tomcat background information is too small to be able to tell where the problem space is (there is no information about the Tomcat log directory) by configuring the Tomcat log to allow it to record more log information before further analysis of the cause. In the Web App directory that cannot be launched (I am here st) under the Web-inf/classes directory, create a new Logging.properties file with the following content reference

handlers = Org.apache.juli.FileHandler, Java.util.logging.ConsoleHandler
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


Restart Tomcat, under the Logs folder, you will see a error-debug.log2016-05-23.log, such as:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/80/73/wKiom1dCaCyyyV0BAAAmsc4hB1c586.png "title=" 5.png " alt= "Wkiom1dcacyyyv0baaamsc4hb1c586.png"/>

More Error-debug.log2016-05-23.log, find an error message:

Severe:exception sending context initialized event to listener instance of class Org.springframework.web.context.Context Loaderlistener org.springframework.beans.factory.BeanDefinitionStoreException:Invalid Bean definition with name ' DATASOURCEJDBC ' defined in file [/usr/local/oss/greenpass/wtpwebapp/greenpass/web-inf/classes/config/spring/ Spring-datasource.xml]: Could not resolve placeholder ' db1.driver ' in string value

"${db1.driver}"

found that the Web root of the spring-datasource.xml inside the db1.driver is not defined, with the development of this problem, commented out this part of the code will be able to access the normal.


Note: Server.xml contains information about the logs configuration, as follows:

<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"

prefix= "Localhost_access_log" suffix= ". txt"

pattern= "%h%l%u%t &quot;%r&quot; %s%b "/>

The default is on, a separate log is generated every day, for example: Localhost.2016-05-22.log, this piece of my configuration is not known for what reason was written off, otherwise it will not take so long.

This article is from the Linux Technical Exchange blog, so be sure to keep this source http://9678130.blog.51cto.com/9668130/1782050

Record the tomcat troubleshooting process

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.