Glassfish installation for Java

These directions for Glassfish supplement the Java installation directions:

To install the New Relic Java agent on Glassfish:

  1. Access the Glassfish console.

  2. In the left sidebar, select Application Server > JVM Settings tab > JVM Options.

  3. On the JVM Options page, select Add JVM Option.

  4. Add an entry for the -javaagent switch.

  5. Select Save.

  6. Restart Glassfish.

The server should now be instrumented.

Screen java agent glassfish normal.jpg
Application Server > JVM Settings > JVM Options: Add the -javaagent switch in the Glassfish JVM options page.

If Glassfish does not start, the -javaagent switch might not have been set correctly. You can change the server jvm switches by editing the domain.xml file (glassfish/domains/{domain}/config/domain.xml).

Caution: There is a bug in Glassfish 2.1 that prevents classes on the bootstrap class loader (the New Relic agent) from using the Java logging API. This appears to be fixed in 2.1.1 and later releases.

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