问题
does anybody have some ideas on how to achieve that? Or even a good documentation on how to do that?
Basicly everything is done in a test standalone version (by a java client or jconsole I am able to call mbeans methods and everything works fine), but I need to put it in my Tomcat servlet....
Thanks for every suggestions!
Rob
回答1:
The Tomcat docs on monitoring describe how to enable JMX for Tomcat process's JVM. The short answer is you have to get the com.sun.management.jmxremote.* system properties set somehow -- either through the CATALINA_OPTS, or the start up script or the Windows service definition.
And have MBeans in your deployed app(s), of course.
回答2:
Just attach the jconsole to your Tomcat process and you should be able to see any MBeans defined by your Servlet.
来源:https://stackoverflow.com/questions/914775/jmx-and-tomcat-create-and-use-mbeans-in-a-servlet