How to enable JMX?

After encountering performance problems, I’ve been trying to determine where our code is spending all its time. Ideally I’d like to use jvisualvm or jconsole. To do that, I believe I need to enable JMX connections.

My research so far tells me that I need to specify these options to java:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

I’ve tried appending them to the lax.nl.java.option.additional line in RhythmyxServer.lax and restarting, but when I try connecting to localhost:9010, I still get an error message that the connection isn’t possible. On the other hand, jvisualvm and jconsole have no trouble detecting themselves.

I’ve also tried specifying the options via lax.command.line.args and as part of $JAVA_OPTS in the run.conf. No luck with those either.

Any suggestions?

Thanks.

  • Blair

We have been able to debug with visualvm by adding the following to the end of lax.nl.java.option.additional in RhythmyxServer.lax
-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

Maybe try adding the first option to what you’re doing (jmxremote=true) since you’re debugging a remote jvm?

Thanks! It’s amazing how much difference it makes when you use the correct options. Dunno whether that’s a copying error on my part, or an omission in the original source, but adding “=true” to the initial “.jmxremote” makes all the difference.