Jira fails to start on Java 11 with plugin load errors when integrated with a monitoring agent

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

Summary

When Jira is using Java 11 and it has custom parameters like "-Datlassian.org.osgi.framework.bootdelegation" or "-javaagent", Jira fails to start due to system plugins failing to start. 

This problem typically occurs if Jira is integrated with a monitoring agent and is being moved from Java 8 to Java 11.
But it was found environments failing to start even not having these parameters in place.

Environment

  • Jira Version 8 and above
  • Java 11
  • Java startup parameter "-Datlassian.org.osgi.framework.bootdelegation" or "-javaagent" is set, as is common when using a monitoring agent

Diagnosis

To determine whether you are affected by this problem, check the following

  1. Open the JIRA_INSTALL/logs/catalina.out log file in a text editor
  2. Check the latest startup in the logs by looking for the last occurrence of "JIRA starting"
  3. Under the Environment heading, Java Version is listed as Java 11 or above
  4. Under the Java System Properties heading, you see atlassian.org.osgi.framework.bootdelegation listed

Jira fails to start with the following errors displayed:

On Jira's startup screen (failed plugins may change)

System plugins failed to start: We haven't been able to start all the required system plugins

We couldn't start the following plugins:

  • Jira Projects Plugin (com.atlassian.jira.jira-projects-plugin)
  • Atlassian OAuth Consumer Plugin (com.atlassian.oauth.consumer)
  • Atlassian Navigation Links Plugin (com.atlassian.plugins.atlassian-nav-links-plugin)
  • Atlassian Jira - Plugins - OAuth Service Provider SPI (com.atlassian.jira.oauth.serviceprovider)
  • Atlassian Jira - Plugins - Project Config Plugin (com.atlassian.jira.jira-project-config-plugin)
  • Applinks - Plugin - Core (com.atlassian.applinks.applinks-plugin)
  • Atlassian OAuth Service Provider Plugin (com.atlassian.oauth.serviceprovider)
  • And so on...

In Jira's application logs

Atlassian core plugins fail to load with java.lang.NoClassDefFoundError: jdk/internal/reflect/MethodAccessorImpl and/or java.lang.ClassNotFoundException: Unable to load class 'jdk.internal.reflect.ConstructorAccessorImpl

YYYY-MM-DD HH:MM:SS,nnn ThreadPoolAsyncTaskExecutor::Thread 1 ERROR      [c.a.p.osgi.factory.OsgiPlugin] Unable to start the plugin container for plugin 'com.atlassian.templaterenderer.api'
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [bundle://174.0:0/META-INF/spring/atlassian-plugins-component-imports.xml]; nested exception is java.lang.NoClassDefFoundError: jdk/internal/reflect/MethodAccessorImpl
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
<snip>
Caused by: java.lang.NoClassDefFoundError: jdk/internal/reflect/MethodAccessorImpl
	at java.base/jdk.internal.misc.Unsafe.defineClass0(Native Method)
	at java.base/jdk.internal.misc.Unsafe.defineClass(Unsafe.java:1192)
	at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
	at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400)
	at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)
	at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)
	at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateMethod(MethodAccessorGenerator.java:75)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:53)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
<snip>
Caused by: java.lang.ClassNotFoundException: Unable to load class 'jdk.internal.reflect.MethodAccessorImpl'
	at org.apache.felix.framework.BundleWiringImpl$1.loadClass(BundleWiringImpl.java:92)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1583)
	at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
	... 41 more

YYYY-MM-DD HH:MM:SS,nnn ThreadPoolAsyncTaskExecutor::Thread 2 ERROR      [c.a.p.osgi.factory.OsgiPlugin] Unable to start the plugin container for plugin 'com.atlassian.jira.oauth.consumer'
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [bundle://88.0:0/META-INF/spring/spring-components.xml]; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader]: Unresolvable class definition; nested exception is java.lang.NoClassDefFoundError: jdk/internal/reflect/ConstructorAccessorImpl
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
<snip>
Caused by: java.lang.ClassNotFoundException: Unable to load class 'jdk.internal.reflect.ConstructorAccessorImpl'
	at org.apache.felix.framework.BundleWiringImpl$1.loadClass(BundleWiringImpl.java:92)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1504)
	at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
	... 36 more


Cause

Startup parameters "-Datlassian.org.osgi.framework.bootdelegation" and/or "-javaagent" may have been defined.
This parameter is missing jdk.internal.reflect and jdk.internal.reflect.*, which is required for Atlassian OSGi plugins to load correctly on Java 11 and above. 

Workaround

Setting the atlassian.org.osgi.framework.bootdelegation parameter is not supported by Atlassian.
It's is recommended to use atlassian.org.osgi.framework.bootdelegation.extra instead.

For more information, please see the article Adding classes to OSGi boot class loader (BootDelegation)

  1. Locate where -Datlassian.org.osgi.framework.bootdelegation is being defined. This is typically in JIRA_INSTALL/bin/setenv.sh
  2. At the end of the -Datlassian.org.osgi.framework.bootdelegation parameter, add ,jdk.internal.reflect,jdk.internal.reflect.* . For example:

    -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.*
  3. Restart Jira

Solution

Remove any javaagent and bootdelegation parameters:

  1. Locate where -Datlassian.org.osgi.framework.bootdelegation or -javaagent is being defined. This is typically in the file JIRA_INSTALL/bin/setenv.sh
  2. Remove any -javaagent and -Datlassian.org.osgi.framework.bootdelegation parameters
  3. Restart Jira

To continue using your monitoring agent with Jira, contact the agent vendor to set things up using atlassian.org.osgi.framework.bootdelegation.extra instead.
For more information, please see article Adding classes to OSGi boot class loader (BootDelegation)

Alternative Solution

As an alternative solution, Java JRE/JDK can be reverted back from 11 to 8.
For more details, please check the document How to change the Java version used by Jira





Last modified on Feb 17, 2022

Was this helpful?

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