hibernate/hibernate-orm · error · ServiceException

Could not initialize custom PersisterFactory impl [%s]

Error message

Could not initialize custom PersisterFactory impl [%s]

What it means

Error "Could not initialize custom PersisterFactory impl [%s]" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/persister/internal/PersisterFactoryInitiator.java:50

		final Object customImpl = configurationValues.get( IMPL_NAME );
		if ( customImpl == null ) {
			return new PersisterFactoryImpl();
		}

		if ( customImpl instanceof PersisterFactory persisterFactory ) {
			return persisterFactory;
		}

		@SuppressWarnings("unchecked")
		final var customImplClass =
				customImpl instanceof Class
						? (Class<? extends PersisterFactory>) customImpl
						: locate( registry, customImpl.toString() );
		try {
			return customImplClass.newInstance();
		}
		catch (Exception e) {
			throw new ServiceException( "Could not initialize custom PersisterFactory impl [" + customImplClass.getName() + "]", e );
		}
	}

	private Class<? extends PersisterFactory> locate(ServiceRegistryImplementor registry, String className) {
		return registry.requireService( ClassLoaderService.class ).classForName( className );
	}
}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Verify the class configured via hibernate.persister_factory implements PersisterFactory and has a public no-arg constructor.
  2. Check the configured class name for typos and classpath availability.

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/7860c78595a3a214. Report an issue: GitHub.