如何使用 JMXWS WS 连接器 (JSR-262) 启动 VisualVM?

发布于 2024-08-03 12:46:18 字数 598 浏览 3 评论 0原文

我有一个在 JBoss 中运行的 Java 应用程序,其中启用了 JMX远程监控。这使我能够连接 jconsole 和 VisualVM 等工具来监控内存使用情况、CPU 利用率、mbean 等。不过,运行我的应用程序的服务器具有限制性端口访问,这就是我使用 的原因JSR-262 JMX WS 连接器

JSR-262 实现有一个示例,说明如何为 jconsole 启用 jmx:ws 协议。但我想对 VisualVM 尝试同样的操作。

我相信我必须做的是,在启动 VisualVM 时:

  1. 将一些额外的 JSR-262 jar 添加到类路径
  2. 将 java.endorsed.dirs 设置为未捆绑的 JAXWS 库所在的路径

有人能指出我正确的方向吗?是否有一种机制可以为 VisualVM 提供额外的参数?它会起作用吗?还有更简单的方法吗?

I have an Java application running in JBoss in which I have enabled JMX remote monitoring. This allows me to connect with tools such as jconsole and visualvm to monitor memory usage, cpu utilization, mbeans, and more. The server on which my application is running has restrictive port access though, which is why I am using the JSR-262 JMX WS Connector.

The JSR-262 implementation has an example of how you enable jmx:ws protocol for jconsole. But I would like to try the same for visualvm.

What I believe I have to do is, when launching visualvm:

  1. Add a number of additional JSR-262 jars to the classpath
  2. Set the java.endorsed.dirs to a path where the unbundled JAXWS libraries reside

Can someone point me in the right direction? Is there a mechanism to provide additional arguments to visualvm? Will it work at all? Is there even an easier way?

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

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

发布评论

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

评论(1

地狱即天堂 2024-08-10 12:46:18

我找到了答案。在运行 Linux 版本的 VisualVM 时,我发现有许多可用的命令行参数:

General options:
  --help                show this help 
  --nosplash            do not show the splash screen
  --jdkhome       path to Java(TM) 2 SDK, Standard Edition
  -J        pass  to JVM

  --cp:p     prepend  to classpath
  --cp:a     append  to classpath
Core options:
  --laf  use given LookAndFeel class instead of the default
  --fontsize      set the base font size of the user interface, in points
  --locale  use specified locale
  --userdir       use specified directory to store user settings

Module reload options:
  --reload /path/to/module.jar  Installs or reinstalls a module JAR file.

Additional Module(s) Option(s):
  --openjmx            open application specified by JMX connection (host:port)
  --openid             open application with id 
  --openpid            open application with process id 
  --openfile           open file specified by , file can be Application snapshot, NetBeans Profiler snapshot or HPROF heap dump.

这导致我尝试以下命令:

visualvm\bin\visualvm -cp:a lib\wiseman-core.jar;lib\jmxws.jar -J-Djava.endorsed.dirs=lib\endorsed

它的作用就像一个魅力。

I found the answer. Upon running the linux version of visualvm, I found that there are are number of commandline arguments available:

General options:
  --help                show this help 
  --nosplash            do not show the splash screen
  --jdkhome       path to Java(TM) 2 SDK, Standard Edition
  -J        pass  to JVM

  --cp:p     prepend  to classpath
  --cp:a     append  to classpath
Core options:
  --laf  use given LookAndFeel class instead of the default
  --fontsize      set the base font size of the user interface, in points
  --locale  use specified locale
  --userdir       use specified directory to store user settings

Module reload options:
  --reload /path/to/module.jar  Installs or reinstalls a module JAR file.

Additional Module(s) Option(s):
  --openjmx            open application specified by JMX connection (host:port)
  --openid             open application with id 
  --openpid            open application with process id 
  --openfile           open file specified by , file can be Application snapshot, NetBeans Profiler snapshot or HPROF heap dump.

This led me to trying the following command:

visualvm\bin\visualvm -cp:a lib\wiseman-core.jar;lib\jmxws.jar -J-Djava.endorsed.dirs=lib\endorsed

which works like a charm.

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