Can't stop tomcat normally when I configure jmxremote

淺唱寂寞╮ 提交于 2019-12-21 12:31:32

问题


I added a jmxremote configuraiton in the catalina.bat:

set JAVA_OPTS=-Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

so that I could start jconsole to monitor the tomcat's performance.

But I got a problem that I couldn't stop tomcat normally through $CATALINA_HOME\catalina.bat stop, neither did $CATALINA_HOME\shutdown.bat

Any suggestions?


回答1:


There are 2 things:

  • Please have a look at my blog post, where I summarized how to do it properly (having encountered this in the past...)
  • Make sure that you put the definitions in a place only the start command sees, but not the shutdown. The reason or this is that the jmx remote create a listening socket, making the shutdown to listen to the same port if not configured properly.



回答2:


Are you sure Tomcat started successfully?

Usually you need to add this property before the other jmx properties:

-Dcom.sun.management.jmxremote

http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Enabling_JMX_Remote




回答3:


Better to add these parameters to the CATALINA_OPTS in the file setenv.sh or setenv.bat

# JMX OPTIONS
CATALINA_OPT="$CATALINA_OPT "-Dcom.sun.management.jmxremote
CATALINA_OPT="$CATALINA_OPT "-Dcom.sun.management.jmxremote.port=9012
CATALINA_OPT="$CATALINA_OPT "-Dcom.sun.management.jmxremote.local.only=false
CATALINA_OPT="$CATALINA_OPT "-Dcom.sun.management.jmxremote.authenticate=false
CATALINA_OPT="$CATALINA_OPT "-Dcom.sun.management.jmxremote.ssl=false


来源:https://stackoverflow.com/questions/8199630/cant-stop-tomcat-normally-when-i-configure-jmxremote

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