HibernateSystemException - Unknown entity class

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

Symptoms

An error containing "org.springframework.orm.hibernate.HibernateSystemException: Unknown entity class:" such as the following appears in the atlassian-confluence.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 org.springframework.orm.hibernate.HibernateSystemException: Unknown entity class: com.atlassian.confluence.user.persistence.dao.ConfluenceRememberMeToken; nested exception is net.sf.hibernate.MappingException: Unknown entity class: com.atlassian.confluence.user.persistence.dao.ConfluenceRememberMeToken Caused by: net.sf.hibernate.MappingException: Unknown entity class: com.atlassian.confluence.user.persistence.dao.ConfluenceRememberMeToken at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347) at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2716) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2723) at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:772) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:747) at org.springframework.orm.hibernate.HibernateTemplate$9.doInHibernate(HibernateTemplate.java:568) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.save(HibernateTemplate.java:565) at com.atlassian.confluence.user.rememberme.DefaultConfluenceRememberMeTokenDao.save(DefaultConfluenceRememberMeTokenDao.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)

Diagnosis

Check whether there are customisations to databaseSubsystemContext.xml.

  1. Is there a WEB-INF/classes/databaseSubsystemContext.xml file?

  2. Are there alterations to the databaseSubsystemContext.xml file within the confluence.jar file.

Cause

The databaseSubsystemContext.xml feeds the list of entity mappings to Hibernate. If this has been customised and not updated at upgrade-time, then it will be missing any new entity mappings that are resolved. So in 3.4 this means the ConfluenceRememberMeToken, but in future/earlier versions it will mean other entities.

Solution

Resolution

  1. Fix the databaseSubystemContext.xml. Either:

    • If there are no deliberate modifications to databaseSubsystemContext.xml, remove the file.

    • If there are deliberate modifications, then unzip databaseSubsystemContext.xml out of confluence.jar and re-apply the modifications

  2. Add -Datlassian.forceSchemaUpdate=true to Confluence's system properties. This will create any tables that were missed because of the missing entity mapping.

  3. Restart Confluence

  4. Check that extra tables are added and then remove the -Datlassian.forceSchemaUpdate=true flag.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.