what is JMX?
the jmx interface on your java application will let you monitor and publish graphs for:
- heap memory
- threads and their stack trace
- memory pools
and it will also expose the java Mbeans tree which you can browse
with the jconsole app included with any java distribution:
you can either browse and read these attributes,
and in some cases edit them and change the application status.
Enabling JMX in Tomcat
to enable JMX in tomcat,
edit the wrapper.conf file , and add these lines:
Things to verify before usage:
- the numbers after the “wrapper.java.additional.” part are in increasing order – make sure to continue from where the last config line showed, and make sure there are no gaps in the counting.
- change <port> to the port number you wish to expose
- these settings will enable password-less connection to you JMX server, if you wish to add authentication and SSL you will need to change these settings.
- change <
ServerName> to your server name – this setting is needed – without it the server will only allow localhost connections and wont allow remote.