在Servlet中创建和使用MBean

在Servlet中创建和使用MBean

本文介绍了JMX和Tomcat:在Servlet中创建和使用MBean的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人对实现该目标有一些想法吗?甚至是关于如何执行此操作的良好文档?

does anybody have some ideas on how to achieve that? Or even a good documentation on how to do that?

基本上,所有操作都是在测试独立版本中完成的(通过Java客户端或jconsole,我可以调用mbeans方法,并且一切正常,但是我需要将其放入我的Tomcat servlet中....

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....

感谢每一个建议!

Rob

推荐答案

Tomcat文档关于监控介绍如何为Tomcat进程的JVM启用JMX.简短的答案是,您必须以某种方式获取com.sun.management.jmxremote.*系统属性集-通过CATALINA_OPTS或启动脚本或Windows服务定义.

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.

当然要在已部署的应用程序中包含MBean.

And have MBeans in your deployed app(s), of course.

这篇关于JMX和Tomcat:在Servlet中创建和使用MBean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 23:43