The GlassFish application server versions 3.x and later uses OSGi architecture. By default, OSGi containers follow a specific model for bootstrap class delegation. Classes that are not specified in the container's CLASSPATH are not delegated to the bootstrap classloader; therefore you must configure the OSGi containers for the Java Agentclasses.

For more information, see GlassFish OSGi Configuration per Domain.

To ensure that the OSGi container identifies the Java Agent, specify the following package prefix:


This prefix follows the regular boot delegation model so that the Java Agent classes are visible.

If you already have existing boot delegations, add "com.singularity.*" to the existing path separated by a comma. For example:

org.osgi.framework.bootdelegation=com.sun.btrace., com.singularity.

Configure Eclipse Equinox

If running Eclipse Equinox under Glassfish:

  1. Open the config.ini file located at <glassfish install directory>/glassfish/osgi/equinox/configuration.
  2. Add the following package prefix to the config.ini file:


If running Eclipse Equinox under the WebSphere Application Server Liberty profile:

  1. Open the file in the JVM directory <WLP_home>/usr/servers/<server_name> for editing.
  2. Add the following line:


For more information see Getting Started with Equinox.

Configure Apache Sling

  1. Open the file. The location of the varies depending on the Java platform.
    In the Sun/Oracle implementation, the file is located at <java.home>/lib
  2. Add following package prefix to the file:


Configure JIRA or Confluence

For JIRA 5.1.8 and newer and Confluence 5.3 and newer:

  1. Open the startup script (that is, for editing.  

  2. Look for the start command block (look for "elif [ "$1" = "start" ] ; then") 

  3. Add the following Java system property alongside the existing properties in both else blocks:,com.yourkit,com.singularity.*,com.jprofiler,com.jprofiler.*,org.apache.xerces,org.apache.xerces.*,org.apache.xalan,org.apache.xalan.*,sun.*,com.sun.jndi,com.icl.saxon,com.icl.saxon.*,javax.servlet,javax.servlet.*,com.sun.xml.bind.*\
  4. Add the property to the run command block as well to instrument the application started in run mode. For example: 


  5. Before the comment line 'Execute The Requested Command', add the –javaagent argument to the file as a new Java option as follows:

    JAVA_OPTS="$JAVA_OPTS -javaagent:<agent_home>/javaagent.jar"
    set JAVA_OPTS=%JAVA_OPTS% -javaagent:"Drive:<agent_home>\javaagent.jar"
  6. Restart the application.

Configure Other OSGi-based Containers

For other OSGI-based runtime containers, add the following package prefix to the appropriate OSGi configuration.*