How do I start VisualVM with the JMXWS WS Connector (JSR

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:

  • Add a number of additional JSR-262 jars to the classpath
  • 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?


    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:

    visualvmbinvisualvm -cp:a libwiseman-core.jar;libjmxws.jar -J-Djava.endorsed.dirs=libendorsed
    

    which works like a charm.

    链接地址: http://www.djcxy.com/p/79954.html

    上一篇: VisualVM:比较两个版本的相同应用程序的性能

    下一篇: 如何使用JMXWS WS连接器(JSR)启动VisualVM