I was trying to configure JVM for remote monitoring but getting the below error on server
The configuration has not been set for this resource due to : Invalid configuration: Error contacting resource: Can't connect to MBeanServer [{jmx.username=system, jmx.url=service:jmx:rmi:///jndi/rmi://localhost:6969/jmxrmi}]: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused]
I want to monitor tomcat server, according to the doc I have add the remote monitoring Mbean Server connection string in /tomcat/bin/catalina.sh file
[ $1 != "stop" ] && JAVA_OPTS="-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=6969 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false $JAVA_OPTS"
export JAVA_OPTS
I have restarted the tomcat service after that. But not able to see port 6969 listening on the server. After restarting the tomcat i have checked it via "netstat -an | grep 696" I think this is the problem. Port 6969 is not used on this machine.