Installing the Java agent on Glassfish
To install the New Relic java agent on Glassfish, start Glassfish and access the console.
Click Application Server in the left hand tree, then click the JVM Settings tab, and the JVM Options tab under that.
On the JVM Options page, click Add JVM Option, and add an entry for the -javaagent switch. Click Save.

Restart Glassfish. The server should now be instrumented.
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).
There is an issue with the Java agent logs stopping shortly after Glassfish starts with the pre-GA agent. The agent will continue to operate correctly, it just won't write any log messages. This will be fixed in the GA release.