爱国者 爱国者 - 1 month ago 9
Java Question

Can't stop tomcat normally when I configure jmxremote

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 suggestion ?

Answer

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.
Comments