Bitbucket gets stuck while installing a plugin and fails to start up when restarted because the plugin was compiled in a more recent Java version

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

Bitbucket appears to hang while installing a plugin.

Sample screenshot

When a restart is then attempted, Bitbucket fails to start up and shows an error in the UI.

Sample screenshot

Environment

Any case where the plugin was compiled in a newer Java runtime than the one Bitbucket is using. Example: Bitbucket running on Java 8 while the plugin being installed was compiled in Java 11.

Diagnosis

A review of the Bitbucket application logs ($BITBUCKET_HOME/log/atlassian-bitbucket.log) shows the following error during plugin installation and during restart:

2022-05-04 09:59:02,026 ERROR [ThreadPoolAsyncTaskExecutor::Thread 27]  c.a.plugin.osgi.factory.OsgiPlugin Unable to start the plugin container for plugin 'de.scandio.bitbucket.plugins.favourites'
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'componentImportBeanFactoryPostProcessor': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [eu.asksoftware.bitbucket.favorites.FavoritesResource] for bean with name 'favoritesResource': problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: eu/asksoftware/bitbucket/favorites/FavoritesResource has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:501)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:359)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:251)
	at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:217)
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:224)
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:177)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:154)
	at org.eclipse.gemini.blueprint.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:213)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.lang.Thread.run(Thread.java:748)
	... 10 frames trimmed
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [eu.asksoftware.bitbucket.favorites.FavoritesResource] for bean with name 'favoritesResource': problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: eu/asksoftware/bitbucket/favorites/FavoritesResource has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1545)
	... 12 common frames omitted
Caused by: java.lang.UnsupportedClassVersionError: eu/asksoftware/bitbucket/favorites/FavoritesResource has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:136)
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:212)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:284)
	... 12 common frames omitted

The error indicates that the plugin being installed was compiled in Java 11 (class file 55.0) but Bitbucket was running on Java 8 (class file 52.0). The Java runtime cannot recognize the newer class files.

Cause

Bitbucket fails to install the plugin and fails to start up because a plugin classes are not recognized by the Java runtime used by Bitbucket.

Solution

To be able to start up Bitbucket, the .jar file for the plugin needs to be removed from the shared file system.

Procedures:

  1. Shut down Bitbucket on all nodes
  2. On the filesystem, go to the $BITBUCKET_HOME/shared/plugins/installed-plugins directory
  3. Look for the .jar file for the plugin. The filename name would be something like plugin.<hash>.<plugin-key>-<plugin-version>.jar
  4. Remove the .jar file
  5. Restart Bitbucket

In addition, please review plugin documentation for their supported environments.


Last modified on Jun 23, 2022

Was this helpful?

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