Bamboo Data Center deployment projects page fails with 'cannot instantiate abstract class or interface' error

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

Symptoms

Bamboo UI shows this error while navigating t to the deployments page.

Background page refresh cannot contact server. Please ensure Bamboo server is available. The error was:
Internal Server Error

This type of errors appear in the Bamboo server logs:

2013-12-18 09:43:33,239 INFO [http-bio-8085-exec-13] [AccessLogFilter] root GET http://localhost:8085/bamboo/rest/api/latest/deploy/dashboard/?_=1387388613232 114073kb
2013-12-18 09:43:33,277 ERROR [http-bio-8085-exec-13] [FiveOhOh] 500 Exception was thrown.
org.codehaus.jackson.map.JsonMappingException: Cannot instantiate abstract class or interface: com.atlassian.bamboo.deployments.versions.persistence.items.AbstractMutableDeploymentVersionItem; nested exception is net.sf.hibernate.HibernateException: Cannot instantiate abstract class or interface: com.atlassian.bamboo.deployments.versions.persistence.items.AbstractMutableDeploymentVersionItem (through reference chain: com.google.common.collect.TransformingRandomAccessList[0])
    at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:218)
    at org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:197)
    at org.codehaus.jackson.map.ser.std.SerializerBase.wrapAndThrow(SerializerBase.java:166)
    at org.codehaus.jackson.map.ser.std.StdContainerSerializers$IndexedListSerializer.serializeContents(StdContainerSerializers.java:127)
    at org.codehaus.jackson.map.ser.std.StdContainerSerializers$IndexedListSerializer.serializeContents(StdContainerSerializers.java:71)
    at org.codehaus.jackson.map.ser.std.AsArraySerializerBase.serialize(AsArraySerializerBase.java:86)
    at org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:610)
    at org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:256)
    at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1604)
    at org.codehaus.jackson.jaxrs.JacksonJsonProvider.writeTo(JacksonJsonProvider.java:558)
    at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437)
...
Caused by: org.springframework.orm.hibernate.HibernateSystemException: Cannot instantiate abstract class or interface: com.atlassian.bamboo.deployments.versions.persistence.items.AbstractMutableDeploymentVersionItem; nested exception is net.sf.hibernate.HibernateException: Cannot instantiate abstract class or interface: com.atlassian.bamboo.deployments.versions.persistence.items.AbstractMutableDeploymentVersionItem
    at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:597)
    at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353)
    at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375)
    at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)
    at com.atlassian.bamboo.persistence3.HibernateDaoUtils.execute(HibernateDaoUtils.java:90)
    at com.atlassian.bamboo.deployments.results.persistence.DeploymentResultDaoImpl.getLatestKnownDeploymentResultForEnvironment(DeploymentResultDaoImpl.java:221)
    at sun.reflect.GeneratedMethodAccessor602.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
...
Caused by: org.springframework.orm.hibernate.HibernateSystemException: Cannot instantiate abstract class or interface: com.atlassian.bamboo.deployments.versions.persistence.items.AbstractMutableDeploymentVersionItem; nested exception is net.sf.hibernate.HibernateException: Cannot instantiate abstract class or interface: com.atlassian.bamboo.deployments.versions.persistence.items.AbstractMutableDeploymentVersionItem
    at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:597)
    at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353)
    at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375)
    at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)
    at com.atlassian.bamboo.persistence3.HibernateDaoUtils.execute(HibernateDaoUtils.java:90)
    at com.atlassian.bamboo.deployments.results.persistence.DeploymentResultDaoImpl.getLatestKnownDeploymentResultForEnvironment(DeploymentResultDaoImpl.java:221)
    at sun.reflect.GeneratedMethodAccessor602.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
...

Cause

In Hibernate, when you define an abstract class and store it in a table, each implementation of that class is stored in a linked table. If a row in the linked table is missing, Hibernate cannot load the class because it cannot instantiate an abstract class directly.

Resolution

The resolution of this type of database corruptions can be running SQL queries to delete the records from the database that refer to the fields that shouldn't exist. Please note that each instance of this database corruption could involve different tables.

  1. Shut down Bamboo
  2. Backup the Bamboo database
  3. Run the following SELECT queries to find entries to delete

    SELECT * FROM deployment_version_item_ba WHERE artifact_id NOT IN (SELECT DISTINCT artifact_id FROM artifact);
    SELECT * FROM DEPLOYMENT_VERSION_ITEM_BA WHERE VERSION_BAM_ARTIFACT_ITEM_ID NOT IN (SELECT DEPLOYMENT_VERSION_ITEM_ID FROM DEPLOYMENT_VERSION_ITEM);
    SELECT * FROM DEPLOYMENT_VERSION_ITEM WHERE DEPLOYMENT_VERSION_ID NOT IN (SELECT DEPLOYMENT_VERSION_ID FROM DEPLOYMENT_VERSION);
    SELECT * FROM DEPLOYMENT_VERSION_ITEM WHERE DEPLOYMENT_VERSION_ITEM_ID NOT IN (SELECT VERSION_BAM_ARTIFACT_ITEM_ID FROM DEPLOYMENT_VERSION_ITEM_BA);
  4. If any of the above return results, run the corresponding DELETE query below:

    DELETE FROM deployment_version_item_ba WHERE artifact_id NOT IN (SELECT DISTINCT artifact_id FROM artifact);
    DELETE FROM DEPLOYMENT_VERSION_ITEM_BA WHERE VERSION_BAM_ARTIFACT_ITEM_ID NOT IN (SELECT DEPLOYMENT_VERSION_ITEM_ID FROM DEPLOYMENT_VERSION_ITEM);
    DELETE FROM DEPLOYMENT_VERSION_ITEM WHERE DEPLOYMENT_VERSION_ID NOT IN (SELECT DEPLOYMENT_VERSION_ID FROM DEPLOYMENT_VERSION);
    DELETE FROM DEPLOYMENT_VERSION_ITEM WHERE DEPLOYMENT_VERSION_ITEM_ID NOT IN (SELECT VERSION_BAM_ARTIFACT_ITEM_ID FROM DEPLOYMENT_VERSION_ITEM_BA);





Last modified on Feb 5, 2025

Was this helpful?

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