hibernate/hibernate-orm · error · MappingException
Could not instantiate collection persister implementor `%s`
Error message
Could not instantiate collection persister implementor `%s` for collection-role `%s`
What it means
Error "Could not instantiate collection persister implementor `%s` for collection-role `%s`" thrown in hibernate/hibernate-orm.
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)
Solutions
- Ensure the custom collection persister implements CollectionPersister and exposes the required constructor.
- Verify the class name configured for the collection role is correct and on the classpath.
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.