Reputation: 85541
I've enabled JMX in Tomcat 7 and I can see most of the data in JConsole and VisualVM, except for the threads. It not reporting any JVM thread data (but does report heap and CPU data).
What am I doing wrong?
Tomcat 7.0.59 running on FreeBSD 10.1 (amd64). OpenJDK 64-Bit Server VM version 24.80-b11. JMX enabled with startup parameters: "-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=xx.xx.xx.xx -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
Upvotes: 1
Views: 1533
Reputation: 54
Edit (or create) $CATALINA_HOME/bin/setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote"
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.port=11999"
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.authenticate=true"
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.password.file=$CATALINA_HOME/conf/jmxremote.password"
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.access.file=$CATALINA_HOME/conf/jmxremote.access"
$CATALINA_HOME/conf/jmxremote.access
:
****grant readwrite access for your account then you can see threads****
yourAccount readwrite
$CATALINA_HOME/conf/jmxremote.password
:
yourAccount yourPassword
And then change mode for these files:
$chmod 600 $CATALINA_HOME/conf/jmxremote.access
$chmod 600 $CATALINA_HOME/conf/jmxremote.password
Then start your Tomcat and login with right ip, port, account and password.
Upvotes: 2