views:

768

answers:

1

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?

+1  A: 

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.

waxwing