After deploying the Web application to tomcat yesterday, it failed to start successfully and the console does not have detailed error messages.
At most, two lines of prompt information, such as:
Serious: Error Listenerstart
Serious: Context [/lizongbo] startup failed due to previous errors
Or
Serious: Error Filterstart
Org.apache.catalina.core.StandardContext start
Serious: Context startup failed due to previous errors
Find the information in the logs directory, in addition to these two words, there is no other ancillary content.
It is difficult to find errors in this case because Tomcat's own default log does not output some error information to the console or file.
This time you need to configure Tomcat's own log to enable verbose debug logging.
The configuration in Tomcat 5.5 and Tomcat 6.0 is basically the same, except that the directories in the related files are different.
#日志级别不能太低, if configured as debug, the output is too much log information, causing Tomcat startup to be very slow.
4.Tomcat 6.0 required Juli replacement files:
Http://www.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/extras/tomcat-juli-adapters.jar
Http://www.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/extras/tomcat-juli.jar
In the Tomcat6.0,
Copy the tomcat-juli-adapters.jar,log4j-1.2.15.jar,log4j.properties to the D:\Java\ApacheTomcat6.0.14\lib below.
Copy the Tomcat-juli.jar to the D:\Java\apache-tomcat-6.0.14\bin\ below.
Then start tomcat and you can see lizongbo.log under the D:\Java\apache-tomcat-6.0.14\logs.
In the Tomcat5.5,
Copy the Commons-logging-1.1.jar,log4j-1.2.15.jar to the D:\Java\apache-tomcat-5.5.25\common\lib below.
Copy the log4j.properties to the D:\Java\apache-tomcat-5.5.25\common\classes below.
Then start tomcat and you can see lizongbo.log under the D:\Java\apache-tomcat-5.5.25\logs.
At this point, and then through the log file to analyze, you will find that this error may occur:
(Here are the error cases I encountered, mostly low-level errors)
1.webapps the Classe file to use is not copied to the Web-inf/classes directory at all
(Java.lang.NoClassDefFoundError, and this information may not be exported to the console by default, especially with spring, yesterday was this careless, low-level error)
2. lib file is not replicated, the Lib is missing
There are several different versions of JAR files for the same library under 3.lib, causing version conflicts.
The jar under 4.lib does not correspond to the Tomcat version (the problem I encountered is that the Web application works on the Tomcat5.5 and there is an error on the Tomcat6.0.
For example, a webapp with struts reported the following error at Tomcat 6
"Parse Fatal Error at line" 6:the processing instruction
Target matching "[Xx][mm][ll]" is not allowed ")
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.