Download PDF
Download page OSGi Infrastructure Configuration.
OSGi Infrastructure Configuration
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.
See GlassFish Startup Settings and GlassFish OSGi Configuration per Domain.
To ensure that the OSGi container identifies the Java Agent, specify this package prefix:
org.osgi.framework.bootdelegation=com.singularity.*
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:
- Open the
config.ini
file located at<glassfish install directory>/glassfish/osgi/equinox/configuration
. Add this package prefix to the
config.ini
file:org.osgi.framework.bootdelegation=com.singularity.*
CODE
If running Eclipse Equinox under the WebSphere Application Server Liberty profile:
- Open the bootstrap.properties file in the JVM directory <WLP_home>/usr/servers/<server_name> for editing.
Add this code line:
org.osgi.framework.bootdelegation=com.singularity.*
CODE
See Getting Started with Equinox.
Configure Apache Sling
- Open the
sling.properties
file. The location of thesling.properties
varies depending on the Java platform.
In the Sun/Oracle implementation, thesling.properties
file is located at<java.home>/lib
. Add this package prefix to the
sling.properties
file:org.osgi.framework.bootdelegation=com.singularity.*
CODE
Configure JIRA or Confluence
For JIRA >= 5.1.8, and Confluence >= 5.3:
Open the startup script (that is,
catalina.sh
) for editing.Look for the
start
command block (look for "elif [ "$1" = "start" ] ; then
")Add the following Java system property alongside the existing properties in both
else
blocks:-Datlassian.org.osgi.framework.bootdelegation.extra=com.singularity.*
CODEAdd the property to the run command block as well to instrument the application started in run mode. For example:
Before the comment line 'Execute The Requested Command', add the
–javaagent
argument to the file as a new Java option:JAVA_OPTS="$JAVA_OPTS -javaagent:<agent_home>/javaagent.jar"
CODEset JAVA_OPTS=%JAVA_OPTS% -javaagent:"Drive:<agent_home>\javaagent.jar"
CODE- Restart the application.
Configure Other OSGi-based Containers
For other OSGI-based runtime containers, add this package prefix to the appropriate OSGi configuration.
file.org.osgi.framework.bootdelegation=com.singularity.*
Configure Apache Karaf
- Open the
custom.properties
file for Karaf. It is located at$KARAF_HOME/etc/custom.properties
.$KARAF_HOME
is the path to the folder where Karaf is installed. Add this package prefix to the
custom.properties
file:org.osgi.framework.bootdelegation=com.singularity.*
CODEImportant
All the values specified in the
custom.properties
file will override the default values specified in the /etc/config.properties
file. So, ensure that you include the default values oforg.osgi.framework.bootdelegation
from theconfig.properties
file to thecustom.properties
file.
Once configured, all applications based on Java Agent Supported Frameworks that are running on Apache Karaf can be instrumented and seen on the Controller UI.