Export fails with InstantiationException
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Problem
The export of Bamboo fails and the following error is found in the atlassian-bamboo.log
:
2019-06-03 14:48:32,886 ERROR [http-nio-8085-exec-25] [Export] org.springframework.orm.hibernate5.HibernateSystemException: Cannot instantiate abstract class or interface: : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem; nested exception is org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem
org.springframework.orm.hibernate5.HibernateSystemException: Cannot instantiate abstract class or interface: : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem; nested exception is org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem
Cause
This issue is caused by database corruption introduced by a bug in Bamboo, BAM-19948 - Deployment project item list not updated when plan artifact is added/modified/removed through specs.
Note: Even if you may be running Bamboo 6.6.2 or newer (which do not contain the bug anymore), the corruption may still be in the database.
Resolution
To resolve this problem, first upgrade Bamboo to version 6.6.2 or newer to prevent the corruption from reoccurring. Once the upgrade was successful, follow these steps to have Bamboo repair the database corruption:
- Create a new plan with an artifact definition. This plan needs no content other than an artifact definition and its sole purpose is to be removed and in the next step.
- Remove this new plan created in step 1. This will trigger Bamboo to execute a DB cleanup and removes orphaned Artifact definition records which triggers the bug in affected plans.