I am trying to configure JVisualVm to monitor an instance of Tomcat 6 (works on Ubuntu Server 10.04 LTS). I saw other questions, but none of them directly answered my problem. I try to connect to Tomcat using JVisualvm, and it returns with the error "Cannot connect", but TCP connections are made on the server; the server disconnects the connection after a short burst of traffic.
I already added this to / etc / default / tomcat 6 and restarted tomcat6
# This enables JMX in order to permit VisualVM to profile the JVM. JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
I started rmiregistry using the default settings:
rmiregistry &
I did not start jstatd ; installing it on the server requires a full JDK, which requires the X libraries. I am not going to install X just to get one single file.
I wonder if jstatd will work with it? I got the impression that I don't need either RMI or jstatd if I can use JMX directly through the JMX port.
There is no firewall between the server and the JVisualvm client, and the iptables host firewall is open. Using jconsole results in the same error.
Running JVisualVM against the local Ubuntu 10.04 machine (using its IP address and JMX port) and adding a JMX instance works fine - and I don't run either rmiregistry or jstatd - although the RMI streams that are running are displayed on the monitor.
Question: What should I do (on the server or on the client) to control Tomcat (and other Java programs) through JMX using JVisualVM?
Thanks in advance.
source share