This article mainly gives you a detailed introduction to the principles of catalina.bat in Tomcat. The article introduces it in great detail through sample code. It has certain reference learning value for everyone's study or work. Friends who need it can refer to it. , let’s learn with the editor below.
Preface
This article mainly provides you with a detailed analysis of the relevant content about the catalina.bat principle in Tomcat, and shares it for your reference and study. Not much to say below, let’s take a look at the detailed introduction.
The actual startup of tomcat is set and started in catalina.bat. startup.bat just finds catalina.bat and executes catalina.bat to start tomat. Let's analyze catalina.bat
Verify the CATALINA_HOME environment variable
Verify that the CATALINA_HOME setting is correct. If not, reset the CATALINA_HOME environment variable.
If catalina.bat is not found in the CATALINA_HOME\bin directory, it will end (this situation will basically not happen here unless catalina.bat is not in tomcat's bin directory )
Set environment variables
tomcat log management
Add tomcat-juli.jar to the classPath environment variable.And add the log configuration file path to the LOGGING_CONFIG environment variable
tomcat-juli.jar Function
Apache Tomcat is implemented by its own java.util .Document the implementation of multiple key elements. This implementation is called JULI. The core component of the implementation is a customized LogManager, which can obtain different web applications (and different class loaders) running in Tomcat. It supports configuring individual log configurations for applications. When a web application is uninstalled from within, it will be notified by Tomcat so that the classes it refers to can be cleared to avoid memory leaks.Console information output
The output is as follows:Set tomcat startup class
Set tomcat remote debugging Relevant parameters
After turning on the remote debugging function, configure the Host and Port in eclipse and then Debug can remotely debug the program in tomcat.Other startup modes
In addition to the remote debugging startup mode, there are also the following startup modesThe above is the detailed content of Introduction to the working principle of catalina.bat in Tomcat. For more information, please follow other related articles on the PHP Chinese website!