I've got a vagrant VM which is running tomcat and I wanted to connect VisualVM to monitor the performance of the VM during some tests.
I followed this guide to setup this configuration which recommended creating a setenv.sh script and placing it within /usr/share/tomcat7/bin. I found that setenv wasn't being run, so I placed the following in /etc/tomcat/tomcat.conf instead:
JAVA_OPTS="-Dcom.sun.management.jmxremote=true - Dcom.sun.management.jmxremote.port=9901 -Dcom.sun.management.jmxremote.ssl=false
m.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.rmi.port=9909"
I believe that the config is working as when running the following, I can see the ports active:
[vagrant@localhost ~]$ netstat -lntu | grep 99
tcp6 0 0 :::9901 :::* LISTEN
tcp6 0 0 :::9909 :::* LISTEN
Here is my config from the vagrant file:
# Ports enabled for VisualVM to work.
config.vm.network "forwarded_port", guest: 9901, host: 9905
config.vm.network "forwarded_port", guest: 9909, host: 9907
However after entering the following config, or close variations of (have tried 127.0.0.1 & enabling "do not require SSL" all I get is " ".
I have also tried ports 9901, 9905, 9909.
Any thoughts on how to solve this?