hibernate/hibernate-orm · error · MappingException

Could not instantiate persister %s (%s)

Error message

Could not instantiate persister %s (%s)

What it means

Error "Could not instantiate persister %s (%s)" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/persister/internal/PersisterFactoryImpl.java:82

			PersistentClass entityBinding,
			EntityDataAccess entityCacheAccessStrategy,
			NaturalIdDataAccess naturalIdCacheAccessStrategy,
			RuntimeModelCreationContext creationContext) {
		final var persisterClass = persisterClassResolver.getEntityPersisterClass( entityBinding );
		final var constructor = resolveEntityPersisterConstructor( persisterClass );
		try {
			return constructor.newInstance( entityBinding, entityCacheAccessStrategy, naturalIdCacheAccessStrategy, creationContext );
		}
		catch (MappingException e) {
			throw e;
		}
		catch (InvocationTargetException e) {
			final var target = e.getTargetException();
			if ( target instanceof HibernateException hibernateException ) {
				throw hibernateException;
			}
			else {
				throw new MappingException(
						String.format(
								Locale.ROOT,
								"Could not instantiate persister %s (%s)",
								persisterClass.getName(),
								entityBinding.getEntityName()
						),
						target
				);
			}
		}
		catch (Exception e) {
			throw new MappingException(
					String.format(
							Locale.ROOT,
							"Could not instantiate persister %s (%s)",
							persisterClass.getName(),
							entityBinding.getEntityName()
					),

View on GitHub (pinned to fad1729dce)

Solutions

  1. Verify the custom persister class has a constructor matching (EntityBinding, EntityMetamodel, PersistenceContext) and is public.
  2. Check the nested cause for the underlying instantiation failure.
  3. Ensure the persister class is on the classpath and loadable.

When it happens

Trigger: Hibernate bootstrap fails to create a configured custom implementation class.

Common situations: A custom persister/factory/resolver class is missing, non-public, or lacks the required constructor.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/7cd0fca7dadb7eef. Report an issue: GitHub.