hibernate/hibernate-orm · error · MappingException

Could not instantiate collection persister implementor

Error message

Could not instantiate collection persister implementor `%s` for collection-role `%s`

What it means

Wraps a reflective instantiation failure while creating a collection persister for a collection role: the persister constructor threw a non-Hibernate exception (InvocationTargetException whose target was not a HibernateException), or another reflective error occurred. The faulty input is the persister class chosen for collectionBinding; the underlying cause is the persister constructor's own failure.

Solutions

  1. Ensure the custom collection persister implements CollectionPersister and exposes the required constructor.
  2. Verify the class name configured for the collection role is correct and on the classpath.
Defensive patterns

Strategy: try-catch

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/57e0969bb5c77ed7. Report an issue: GitHub.

Appendix: source

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

	public CollectionPersister createCollectionPersister(
			Collection collectionBinding,
			@Nullable CollectionDataAccess cacheAccessStrategy,
			RuntimeModelCreationContext creationContext) {
		final var persisterClass = persisterClassResolver.getCollectionPersisterClass( collectionBinding );
		final var constructor = resolveCollectionPersisterConstructor( persisterClass );
		try {
			return constructor.newInstance( collectionBinding, cacheAccessStrategy, creationContext );
		}
		catch (MappingException e) {
			throw e;
		}
		catch (InvocationTargetException e) {
			final Throwable target = e.getTargetException();
			if ( target instanceof HibernateException hibernateException ) {
				throw hibernateException;
			}
			else {
				throw new MappingException(
						String.format(
								"Could not instantiate collection persister implementor `%s` for collection-role `%s`",
								persisterClass.getName(),
								collectionBinding.getRole()
						),
						target
				);
			}
		}
		catch (Exception e) {
			throw new MappingException( "Could not instantiate collection persister " + persisterClass.getName(), e );
		}
	}

	private Constructor<? extends CollectionPersister> resolveCollectionPersisterConstructor(Class<? extends CollectionPersister> persisterClass) {
		try {
			return persisterClass.getConstructor( COLLECTION_PERSISTER_CONSTRUCTOR_ARGS );
		}

View on GitHub (pinned to fad1729dce)