Tomcat command to start shutdown

Source: Internet
Author: User
Tags log throwable tomcat apache tomcat

The core pack for Tomcat startup and shutdown is%tomcat Directory%/bin/bootstrap.jar

Start: Create the Start-up.bat file with the following contents:

Java-jar Bootstrap.jar Start

Off: Create the Shup-down.bat file as follows:

Java-jar Bootstrap.jar Stop

The main method of the Org.apache.catalina.startup.Bootstrap class in Bootstrap.jar is as follows:

public static void Main (string[] args) {try {new objectname ("Test:foo=bar"); The catch (Throwable t) {System.out.println ("This release of Apache Tomcat is packaged to run" J2SE 5.0 \ n or later. It can be run on earlier JVMs by downloading and \ninstalling a compatibility package from the Apache Tomcat \nbinary do
            Wnload page. ");
            try {thread.sleep (5000L);
        catch (Exception ex) {} return;
            } if (daemon = = null) {daemon = new Bootstrap ();
            try {daemon.init ();
                catch (Throwable t) {t.printstacktrace ();
            Return
                The try {String command = "start";//default parameter is start if (Args.length > 0) {
            Command = args[(args.length-1)]; } if (Command.equals ("STARTD")){Args[0] = "start";//Start Method Daemon.load (args);
            Daemon.start ();
            else if (command.equals ("STOPD")) {args[0] = "stop";//Closed Method Daemon.stop ();
                else if (command.equals ("start")) {daemon.setawait (true);//Startup Method Daemon.load (args);
            Daemon.start ();
                else if (command.equals ("Stop")) {daemon.stopserver (args);//Closed method} else { Log.warn ("Bootstrap:command \" "+ Command +" \ "does not exist.");
        Error command join log} catch (Throwable command) {t.printstacktrace (); }
    }

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.