11

I have a simple JMX application that has exposed MBeans based on this tutorial

Is it possible to launch this application with a custom class in the classpath that extends JCONSOLE, so that when a client tries to access it remotely the extended jconsole window opens?

So for example, I create a simple application and package it in MyApp.jar. Then I run it with the following commands in the cmd:

java -classpath JconsoleExtension.jar;MyApp.jar 
-com.sun.management.jmxremote.login.config=management.properties 
-Djava.security.auth.login.config=./sample_jaas.config 
com.test.running.RunningImplementation

With managepement.properties looking something like this:

com.sun.management.jmxremote=true
com.sun.management.jmxremote.port=1234
com.sun.management.jmxremote.login.config=Sample

Is it possible for a client to connect remotely using:

jconsole hostname:1234

And pull up the jconsole window with the extended functionality?

Or, would the client have to reference the extension when trying to connect, so something like:

 jconsole hostname:1234 -classpath JconsoleExtension.jar
Loco234
  • 521
  • 4
  • 20
  • Can't the client invoke 'jconsole' (a program that comes standard with a JDK) and add your JMX app's MBeanServer (and credentials if any) to it and view the MBeans? – Kedar Mhaswade Jun 08 '15 at 16:29
  • Yes, but what i'm looking to do is customise the jconsole view that all the users will see. – Loco234 Jun 08 '15 at 16:32

1 Answers1

4

It looks as if JConsole can't be extended on the server side. The extension needs to be called from the client side, and as such they'd need to have access to the .jar where it's extended.

Loco234
  • 521
  • 4
  • 20