HP Diagnostic: How To Configure a Java Agent on a JBoss Application Server

HP Diagnostics Published on:
HP Diagnostic Proctologist

This post is to help you avoid the “dumb user” syndrome symptoms that I occasionally display.

In a previous project, I was able to install the Java agent on an Apache Tomcat server without issue. For a subsequent project, I needed to install the agent on a JBOSS server. Since I’d never used JBOSS before, I wasn’t really sure how to configure the probe properly.

Where the heck do you put the JVM parameters in JBOSS??

My first obstacle was to determine how to add the Java Agent’s JVM parameters from the HP Diagnostics JRE Instrumenter.

JVM Params

It turned out that I needed to place it in the jboss’s startup script, which in most cases is the run.conf.bat file located in the jboss-5.1.0.GA\bin folder.
Fantastic. One small step done — but the next step, unfortunately, was determining where in the file to actually place the parameters.

Jboss run.config.bat – Does it go here?

Since I’d never used JBoss before, I had no idea where file to place the JVM parameters.

Unfortunately the developer was not much help in this case so, I had to make a bunch of “trial and error” attempts. Finally, after more unsuccessful attempts than I wish to admit, I realized I just need to add the following lines to the end of the run.config.bat file — right before the JAVA_OPTS_SET line:

rem # Add HP Diag insrumentor options

set “JAVA_OPTS=%JAVA_OPTS% -Xbootclasspath/p:C:\MercuryDiagnostics\JavaAgent\DiagnosticsAgent\classes\Sun\1.6.0_18\instr.jre

rem # Add HP Diag instrumenter JVM options

set “JAVA_OPTS=%JAVA_OPTS% -javaagent:C:\MercuryDiagnostics\JavaAgent\DiagnosticsAgent\lib\probeagent.jar”

Everything Working – Right?

Awesome! – Except for the fact than in my case, the newly installed probe still did not appear in the diagnostics Health View. :(

I knew that the JVM parameter was integrated correctly with Jboss and Diagnostics, because I could see that a folder had been created in my “MercuryDiagnostics\JavaAgent\DiagnosticsAgent\log” directory with the name I had given my agent. I could also see that my probe.log file in the same directory did not contain any errors.

JVM Params
After verifying a bunch of things it turns out the solution was embarrassingly simple – the Java Agent was not started.

Make sure the Java Agent is actually running!

I went into the C:\MercuryDiagnostics\JavaAgent\DiagnosticsAgent\bin folder and double- clicked on startAgent.cmd. Normally, after doing a new install of the java agent it starts automatically, but for some reason it didn’t in this case.
JVM Params

After that, everything worked as expected!

5 responses to “HP Diagnostic: How To Configure a Java Agent on a JBoss Application Server”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

HP Diagnostic Proctologist