问题
Is it possible to restart tomcat via JMX? Does tomcat has any mbean that supports restart of all its apps and services?
回答1:
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.
来源:https://stackoverflow.com/questions/4109493/tomcat-restart-via-jmx