简体   繁体   中英

Unable to restart tomcat after enabling jmx remote connection

I wanted to remotely monitor my app running inside tomcat so I configured JMX remote connection inside setenv.sh file.

Following is my configuration.

CATALINA_OPTS="
-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=<jmx_port> 
-Dcom.sun.management.jmxremote.rmi.port=<jmx_port> 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false 
-Djava.rmi.server.hostname=<my_host_ip>".

Note : This is only for test. I won't mind disabled ssl and authenticate = false in my configuration.

I was able to connect to it using visualmv running on my local machine. The problem started when I tried to restart the tomcat. On shutdown process tomcat successfully shutdown but port on which jmx was running was still active and usable by JMX. So on tomcat start, it complained already in use hence failing tomcat startup.

Any help would be highly appreciated.

Are you using the same port for jmxremote.port and jmxremote.rmi.port ? If so, they need to be different. One is the service listener, the other is the rmi registry.

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