1 person found this helpful
The most correct way would probably be to create a plug-in for this for Mission Control. There is an extension point called com.jrockit.mc.rjmx.jmxProtocols explicitly for this purpose. Since I'm guessing this is probably a little bit more work than bargained for, you could try adding the relevant jars to the bootclass path of JMC:
1. To add flags to the JVM, such as -Xbootclasspath/a:, add them after the -vm entry in the jmc.ini file (located next to the jmc launcher in the JDK bin folder). You can also add them by passing the -vm parameter directly to the launcher.
2. There is a file (bin/jconsole.cmd) that wraps the launching of jconsole in the JBoss distribution. From that file you should be able to derive what jar files you need to add, for example modules\org\jboss\remoting3\main\jboss-remoting-3.2.3.GA.jar.
I haven't had the patience to try this, since this is all about custom JBoss stuff.
I'm aware of the jconsole.cmd and I used that to create a startup script for VisualVM, but when I add the JBoss JMX files to the classpath, I still get the following error:
com.jrockit.mc.rjmx.ConnectionException caused by java.net.MalformedURLException: Unsupported protocol: remoting-jmx
Caused by: java.net.MalformedURLException: Unsupported protocol: remoting-jmx
... 4 more
It's like the URL format isn't getting registered because it's in an OSGi container. I'm assuming a META-INF/services entry is being ignored.
I'm not adverse to more work than I bargened for, but I've never created an eclipse plug-in before. Suggestions?
I'll try to whip something together. With some luck I'll have time tomorrow.
I managed to connect by creating a hard-coded -Xbootclasspath/a entry in jmc.ini based on the extended classpath that JBoss's jconsole.bat generates. (Easily copy-pasteable in Windows if you set @echo=on in the bat file).
My jmc.ini now looks something like this (for JBoss EAP 6.1, note that the jar versions needed and their locations differ across versions so you need to get it from jconsole.bat to be sure to get it right).
Also note that the location of the -Xbootclasspath/a in the jmc.ini is important, it must be under -vmargs. And that the syntax requires a colon ':' after -Xbootclasspath/a, a space character will not work, this was new to me since I hadn't used this option before.
And of course, to connect in JMC, you need to select "Custom JMX service URL" and enter the URL according to the JBoss way, service:jmx:remoting-jmx://<host>:<port>
Superb! Thank you! I guess this means I am off the whipping-something-together hook.
I've also got this working, and I've believe I know why my first attempt didn't work.
I had copied the jar files from my development location into a single directory and referenced them there. That does not work.
I believe that additional jar's are necessary and are being found from the MANIFEST.MF Class-Path: entries. This means that operations type people will not be able to connect unless they have WildFly installed so that the JBoss module directory exists with the relative directory structure expected by the manifest file.
So install and reference, don't copy.
Thanks for your help!
I copied all the libraries from jconsole.bat from jboss-eap-6.1 and added in the jmc.ini.
Where is Custom JMX service URL in Java Mission Control?
I see only "Start JMX Console" option.
I am using JMC v5.2. (JDK 7u40)
When you create a new connection, there are two fields "Host" and "Port" and below that there is a button "Custom JMX service URL".
When you click that button, the two fields change to a single field called "JMX service URL" with a default format of
and then you change that to
Cool. It worked.
Comparing JMC to VisualVM and JConsole, what are the benefits/features that we can monitor exclusive to JMC?
Except the fancy charts, I do not see any difference in using free tools such as JConsole and VisualVM.
What are the decision points to purchase the commercial license of JMC?
Thanks for the help.
So after being happy with browsing MBeans, I tried flight recording and got the following:
Error starting recording on localhost:9999 com.jrockit.mc.rjmx.services.flr.FlightRecorderException: Could not start the recording! com.jrockit.mc.rjmx.services.flr.FlightRecorderException: Could not start the recording! at com.jrockit.mc.rjmx.services.flr.internal.FlightRecorderService.start(FlightRecorderService.java:82) at com.jrockit.mc.flightrecorder.controlpanel.ui.jobs.StartRecordingJob.run(StartRecordingJob.java:62) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: java.io.IOException: java.lang.ClassNotFoundException: No classloader available at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:911) at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:152) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.ClassNotFoundException: No classloader available at org.jboss.marshalling.AbstractClassResolver.getClassLoaderChecked(AbstractClassResolver.java:91) at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:135) at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:116) at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:893) at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1205) at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272) at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209) at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) at org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:898) ... 4 more
I'm assuming that flight recording needs either a specific classloader or classes to be visible to the JMX interface and that's not happening.
what classloader or class is flight recording depending on because I assume I will need to add it to the system module in JBoss.
Also, local jfr recordings don't contain ANY events, a one minute recording is around 20 kb and the GUI says there are no events.
Did you start the JVM running JBoss with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder?
1 person found this helpful
JBoss must be okay with creating the com.sun.management.MissionControl, com.sun.management:type=MissionControl MBean. It is in the rt.jar though. It, in turn, needs access to the classes in the jre/lib/jfr.jar.
Yes, and I also had to run JMC as admin.
Is all well now, and everything working for you? Just want to make sure.