JMX and Tomcat: create and use MBeans in a servlet

走远了吗. 提交于 2019-12-11 06:37:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!