tomcat restart via JMX

风流意气都作罢 提交于 2019-12-12 23:51:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!