Export or Import fails with a java.lang.ClassNotFoundException

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

You are either trying to perform an export from an older version or import to a newer version but always fails with a java.lang.ClassNotFoundException This most of the time happens with import.

The atlassian-bamboo.log shows the following:

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 27 28 29 2013-08-27 14:26:42,541 ERROR [qtp1894688899-130] [Export] java.lang.IllegalStateException: Unexpected reflection exception - java.lang.ClassNotFoundException: com.atlassian.bamboo.build.DefaultBuild java.lang.IllegalStateException: Unexpected reflection exception - java.lang.ClassNotFoundException: com.atlassian.bamboo.build.DefaultBuild at org.springframework.util.ReflectionUtils.handleReflectionException(ReflectionUtils.java:136) at com.atlassian.bamboo.security.acegi.acls.HibernateObjectIdentityImpl.<init>(HibernateObjectIdentityImpl.java:81) at com.atlassian.bamboo.security.acegi.acls.HibernateObjectIdentityUserType.nullSafeGet(HibernateObjectIdentityUserType.java:95) at net.sf.hibernate.type.CompositeCustomType.nullSafeGet(CompositeCustomType.java:170) at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:67) at net.sf.hibernate.loader.Loader.hydrate(Loader.java:690) at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:631) at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:590) at net.sf.hibernate.loader.Loader.getRow(Loader.java:505) at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:218) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:285) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138) at net.sf.hibernate.loader.Loader.doList(Loader.java:1063) at net.sf.hibernate.loader.Loader.list(Loader.java:1048) at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1556) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49) at com.atlassian.hibernate.HibernateObjectDao$2.doInHibernate(HibernateObjectDao.java:97) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.hibernate.HibernateObjectDao.findAllSorted(HibernateObjectDao.java:90) at com.atlassian.hibernate.HibernateObjectDao.findAll(HibernateObjectDao.java:78) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)

Cause

It looks like your database contains some leftover data from previous upgrades that needs to be cleaned.

Resolution

Shutdown Bamboo and run the query below to fix the issue and then restart your instance before attempting to import/export

1 2 delete from ACL_ENTRY where ACL_OBJECT_IDENTITY in (select ID from ACL_OBJECT_IDENTITY where OBJECT_ID_CLASS = 'com.atlassian.bamboo.build.DefaultBuild'); delete from ACL_OBJECT_IDENTITY where OBJECT_ID_CLASS = 'com.atlassian.bamboo.build.DefaultBuild';
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.