Enable remote JMX on Jetty
I'm trying to enable remote JMX on a Jetty 6.1.26 instance running on Windows. I have tried several approaches, but the result is always the same:
When I try to connect from jconsole to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
I开发者_如何学JAVA got "connection refused".
I have found several guides on the internet, but no one seems to help. Please note that I'm running Jetty standalone, from the "Jetty-Service.exe" wrapper.
It would be great if someone could suggest a way to enable remote JMX on jetty.
I'm answering my own question.
This is the way I have found to start Jetty with JMX enabled:
java
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=1099
-jar start.jar etc/jetty-jmx.xml etc/jetty.xml
Which Jetty is this? I had to do the same yesterday. First, I had to uncomment etc/jetty-jmx.xml in the start.ini file (installation root.) Then I had to add the same jmx system properties that you mentioned in your comment above. Unless you edit start.ini, you will not see the Jetty-specific MBeans, but you will be able to connect via jConsole.
精彩评论