How to start VisualVM using the JMXWS WS connector (JSR-262)?

I have a Java application running in JBoss in which I have enabled JMX remote monitoring . This allows me to connect to tools like jconsole and visualvm to monitor memory usage, CPU usage, mbeans, etc. The server my application is running on has limited port access, so I use the JSR-262 JMX WS Connector .

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

What I think I need to do when you start visualvm:

  • Add some additional JSR-262 to the classpath
  • Set java.endorsed.dirs to the path where the JAXWS shared libraries reside

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

+5
source share
1 answer

I have found the answer. After running the linux version of visualvm, I found that there are several command line arguments:

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

.

+6

All Articles