简体   繁体   中英

tomcat restart via JMX

Is it possible to restart tomcat via JMX? Does tomcat has any mbean that supports restart of all its apps and services?

So far as I know, there is no specific functionality to do this. However, you can install a custom MBean which will call :

public static final int RESTART_EXIT_CODE = -999;
....
java.lang.System.exit(RESTART_EXIT_CODE);

Then modify the command file that starts the Tomcat service to check the exit code of the JVM process, and if it is equal to the RESTART_EXIT_CODE, then re-invoke the command file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM