after reading and trying a lot around, I have to ask if anyone has a solution for my problem.
I am trying to set up some Tomcats (V6) behind a firewall. This is no b
Problem maybe the second random port opened by java itself when enabling jmx monitoring. Starting from Java 7 this port can be set, too:
-Dcom.sun.management.jmxremote.rmi.port=7091
So in combination - same port can be used:
-Dcom.sun.management.jmxremote.port=7091 -Dcom.sun.management.jmxremote.rmi.port=7091
That was the solution for my problem. Once the port is set to a fixed number, it can be easily set in the firewall.
The answer is putting -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx
to the general JMX options.
An example to automatically set the hostname:
IP=`ifconfig eth0 | grep 'inet '| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'``;
CATALINA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=TRUE
-Dcom.sun.management.jmxremote.password.file=$CATALINA_HOME/conf/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=$CATALINA_HOME/conf/jmxremote.access
-Djava.rmi.server.hostname=$IP"