JBoss installation for Java

These directions for JBoss supplement the Java installation directions:

Note: From version 8.0 and up, JBoss changed its name to WildFly. If you are using WildFly, see WildFly installation for Java.

Domain mode

The domain mode directions are relevant to JBoss versions 6.x EAP or 7.0.x AS and above.

The JVM properties for each server group are found in domain/configuration/domain.xml.

The JVM properties for each server group must be modified to include the -javaagent flag.

<server-group name="main-server-group" profile="full">
  <jvm name="default">
    <jvm-options>
      <option value="-javaagent:/full/path/to/newrelic.jar"/>
    </jvm-options>
  </jvm>
   .
   .
   .
</server-group>

Be sure the -javaagent switch references the full path to the newrelic.jar file.

If you are installing on Windows, be sure to use forward slashes. For example: C:/newrelic/newrelic.jar.

There is a JBoss bug in 7.0.2.Final and 7.1.0.Alpha1 which does not allow jvm-options to be set in the domain.xml file. If you run into this issue, please upgrade your JBoss application server.

Standalone mode

The -javaagent switch should always reference the full path to the newrelic.jar file.

Platform Directions

Unix / Mac OS with 6.x EAP or 7.0.x AS and above

At the bottom of bin/standalone.conf, add this:

JAVA_OPTS="$JAVA_OPTS -javaagent:/full/path/to/newrelic.jar"

Windows with 6.x EAP or 7.0.x AS and above

In bin/standalone.bat, before the line:
set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
add this:

set "JAVA_OPTS=-javaagent:C:/full/path/to/newrelic.jar %JAVA_OPTS%"

Use forward slashes: C:/newrelic/newrelic.jar.

Unix / Mac OS with 6.x and below

At the bottom of bin/run.conf, add this:

JAVA_OPTS="$JAVA_OPTS -javaagent:/full/path/to/newrelic.jar"

Windows with 6.x and below

Add this line to bin/run.bat:

set "JAVA_OPTS=-javaagent:C:/full/path/to/newrelic.jar %JAVA_OPTS%"

Put it before the line: set JBOSS_CLASSPATH=%RUN_CLASSPATH%.

Use forward slashes: C:/newrelic/newrelic.jar.

For more help

Additional documentation resources include:

Join the discussion about Java monitoring in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.