在 Jconsole 中查看 Tomcat 6.0 的 MBean
我正在尝试编写一个小代理来控制tomcat,现在看来JMX对我来说是最好的选择。使用管理器 http 服务,我可以看到注册了各种简洁的 mbean,它们为我提供了我需要的所有信息。唯一的问题是,当我使用 jconsole 连接到 tomcat 实例时,我看不到任何这些 mbean,只看到标准 JVM 的 mbean。
在 tomcat 允许在 jconsole 中查看其 mbean 之前,我需要做某种巫术,还是我误解了 jconsole 的作用?在我了解发生了什么之前,我不想开始尝试编写任何代码。
顺便说一句,我在 win 7 上运行 tomcat 6.0.20 和 java 1.6.0_16。
干杯, 布莱恩.
I'm trying to write a small agent to control tomcat, and right now it looks like JMX is the best option for me. Using the manager http service I can see that there are all sorts of neat mbeans registered that give me all the info I need. Only problem is that when I connect to the tomcat instance using jconsole I don't see any of these mbeans, just the standard JVM ones.
Is there some kind of voodoo I need to do before tomcat will allow its mbeans to be viewed in jconsole, or am I misunderstanding what jconsole does? I don't want to start trying to write any code until I understand what's going on.
BTW, I'm running tomcat 6.0.20 with java 1.6.0_16 on win 7.
Cheers,
Brian.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否按照 tomcat 文档中所示设置了 CATALINA_OPTS?
http://tomcat.apache.org/tomcat-6.0-doc/monitoring。 html
您至少需要“-Dcom.sun.management.jmxremote”才能在与 JVM 相同的计算机上使用 jconsole
Did you set CATALINA_OPTS as shown in the tomcat docs?
http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html
You will need at least "-Dcom.sun.management.jmxremote" to use a jconsole on the same machine as the JVM