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
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.
When a restart is then attempted, Bitbucket fails to start up and shows an error in the UI.

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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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:
Shut down Bitbucket on all nodes
On the filesystem, go to the
$BITBUCKET_HOME/shared/plugins/installed-plugins
directoryLook for the
.jar
file for the plugin. The filename name would be something likeplugin.<hash>.<plugin-key>-<plugin-version>.jar
Remove the
.jar
fileRestart Bitbucket
In addition, please review plugin documentation for their supported environments.
Was this helpful?