Using javaagent with JIRA

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

This problem is related to a third party plugin, and therefore not supported by Atlassian. See Atlassian Supported Plugins for more information.

Problem

JIRA uses the Felix OSGi container.  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 App Server Agent classes.

The following may appears in the log:

2015-11-18 19:06:41,463 ThreadPoolAsyncTaskExecutor::Thread 86 ERROR      [plugin.osgi.factory.OsgiPlugin] Unable to start the plugin container for plugin 'com.arsenalesystems.dataplane'
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataplaneInitialization' defined in URL [bundle://171.0:0/META-INF/spring/atlassian-plugins-components.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type
2016-02-20 09:58:22,284 FelixStartLevel ERROR      [osgi.container.felix.FelixOsgiContainerManager] Error starting file:/opt/atlassian/tools/atlassian-jira-6.4.7-standalone/atlassian-jira/WEB-INF/osgi-framework-bundles/spring-osgi-extender-1.2.1.jar
java.lang.NoClassDefFoundError: com/singularity/ee/agent/appagent/entrypoint/bciengine/FastMethodInterceptorDelegatorBoot
2015-03-25 10:24:13,172 http-bio-8081-exec-11 ERROR admin 624x152x7 njspjb 172.17.20.10 /rest/api/1.0/shortcuts/6338/bcf3cd72864bdf15fe7cb78f017fb406/shortcuts.js [atlassian.plugin.servlet.DefaultServletModuleManager] Unable to create filter
com.atlassian.util.concurrent.LazyReference$InitializationException: javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.SAXParserFactory cannot be created
...
2014-11-11 11:21:14,829 ERROR [http-bio-12000-exec-35] [atlassian.plugin.servlet.DefaultServletModuleManager] getServlet Unable to create servlet
 -- url: /plugins/servlet/whitelist | userName: user | referer: https://your.confluence.url/admin/console.action
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NoClassDefFoundError: javax/servlet/Servlet

Diagnosis

Environment

  • Java options has javaagent:

     -javaagent:/appl/jira/Introscope9.7.0.27/wily/Agent.jar 
    or 
    -javaagent:/local/apps/atlassian/jira_5.2/newrelic/newrelic.jar
    or 
    -javaagent:/opt/appdynamics/javaagent/javaagent.jar

Cause

The container's CLASSPATH is not delegated to the bootstrap classloader

Workaround

To prevent issues, any customised -javaagent and -Datlassian.org.osgi.framework.bootdelegation flags should be removed from the startup parameters, typically in JIRA_INSTALL/setenv.sh

This will however disable the javaagent. 

Resolution

To properly integrate a monitoring agent that requires modification of -javaagent and bootdelegation parameters, please work with agent vendor to find proper resolution.

In some cases adding atlassian.org.osgi.framework.bootdelegation option will help

-Datlassian.org.osgi.framework.bootdelegation=META-INF.services,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.*,jdk.internal.reflect,jdk.internal.reflect.*

-Datlassian.org.osgi.framework.bootdelegation=com.wily,com.wily.*,sun.*,org.w3c.*

Because setting atlassian.org.osgi.framework.bootdelegation overrides the default value, we recommend using the parameter atlassian.org.osgi.framework.bootdelegation.extra instead. See article Adding classes to OSGi boot class loader (BootDelegation)

Additional links:

ca-application-performance-management

OSGi+Infrastructure+Configuration

Adding classes to OSGi boot class loader (BootDelegation)


Last modified on Jul 7, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.