I want to use jmx with Jconsole.Here is the relevant line in the .sh file
## enable jconsole access
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.password.file=/usr/pkg/tomcat-rusznak/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/usr/pkg/tomcat-rusznak/jmxremote.access -Djava.rmi.server.hostname=ba.accra.com"
here is the content of the jmxremote.password file
monitorRole password
controlRole password
here is the content of jmxremote.access file
monitorRole readonly
controlRole readwrite \
create javax.management.monitor.*,javax.management.timer.* \
unregister
But when I provide the correct hostname, port and try to log in with the monitorRole - password pair all what I get is this:
Connection failed: connection refused.
Why?
I checked a lot of similar questions, for example I know from stackoverflow that I need to include the hostname (-Djava.rmi.server.hostname=ba.accra.com) too, but it does not solve the problem, something obviously is misssing. What else do I need?
EDITED
I dont know if it is relevant or not but I would like to add that I had no problem to launch jconsole locally (although the connection is always refused) but I can not even launch it on the server!
jconsole: not found