如何管理 JMX Web 应用程序

发布于 2024-08-02 14:32:02 字数 354 浏览 2 评论 0原文

我已经在 页面上完成了公开 Web 应用程序的 JMX 接口的过程。

我已设法查看 Tomcat JMX 代理上公开的接口,但是当我加载 JConsole 并查找公开的 mbean 接口时,我找不到与公开的属性和操作相关的任何内容。

jconsole 上没有针对 Web 应用程序的特定条目,因此我认为它可能位于 TOMCAT jmx 条目下。它不是。 (请记住,我确实设法在 tomcat jmx 代理页面上看到它)。

如何在本地管理我的 Web 应用程序?为什么 JConsole 不显示?

I've gone through the process on this page to expose the JMX interface of a web application.

I've managed to view the exposed interface on the Tomcat JMX proxy but when I load JConsole and look for the exposed mbean interface I can't find anything related to the attributes and operations exposed.

Thre is no specific entry on jconsole for the web app so I figured it might be under the TOMCAT jmx entry. It's not. (bare in mind, I did manage to see it on the tomcat jmx proxy page).

How can I manage my web application locally? Why is JConsole not showing it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幸福%小乖 2024-08-09 14:32:02

我已经通过执行一些基本步骤来解决这个问题 -

  1. 在 webapp 上下文侦听器 contextInitialized 方法中,我实例化了一个将运行并实现 mbean 的单例类(servlet 本身无法实现 mbean,因为它只唤醒以接受请求来自服务器)。
  2. servlet“通知”单例我们想要监视的每个操作,而单例是通过 jmx 实际报告这一情况的。
  3. 在单例中,我使用以下命令向 mbean 服务器注册:

    ManagementFactory.getPlatformMBeanServer().registerMBean(this, name);

就是这样。 (简而言之)

I've managed to fix this by doing a few basic steps -

  1. In the webapp context listener contextInitialized method, I instantiated a singleton class that will run and implement the mbean (the servlet itself cannot implement an mbean because it only wakes up to take requests from the server).
  2. The servlet "informs" the singleton of every operation that we want to monitor and the singleton is the one that actually reports this through jmx.
  3. In the singleton I registered with the mbean server with this command:

    ManagementFactory.getPlatformMBeanServer().registerMBean(this, name);

Thats it. (In a nut shell)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文