Error: JMX connector server communication error: service:jmx:rmi when stopping/shutdown Tomcat

11,782

Found the answer here:

There isn't. The reason why this is happening is that when tomcat starts, port 5555 (in this example) is bound.

For shutdown, another jvm is launched and gets the same jmx parameters. Therefore, it tries to bind to port 5555, too, fails and shuts the jvm down. The shutdown procedure isn't executed and thus tomcat is still running.

The only fix I could think of is to introduce yet another variable that applies to start and run but not to stop.

I had to set JMX parameters as CATALINA_OPTS and not as JAVA_OPTS and it worked.

Share:
11,782
user435421
Author by

user435421

Updated on June 27, 2022

Comments

  • user435421
    user435421 almost 2 years

    Title says it all. Tomcat 8 (Java 8) is running on Linux. After the error message I see that java process is not killed. Is it a problem with JMX configuration or what?

    export JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=55001 -Dcom.sun.management.jmxremote.authenticate=false"
    export JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.rmi.port=55002 -Djava.rmi.server.hostname=xxxxx -Dcom.sun.management.jmxremote.local.only=false"