hibernate/hibernate-orm · error · IntegrationException
Unable to build the default ValidatorFactory
Error message
Unable to build the default ValidatorFactory
What it means
Last-resort failure in getValidatorFactory: neither a factory supplied via SessionFactoryOptions nor one configured via ConfigurationService settings was available, so Hibernate attempted Validation.buildDefaultValidatorFactory() and that threw. Typically means no Jakarta Validation provider is on the classpath or provider initialization failed.
Solutions
- Inspect the root cause exception in the log; the default ValidatorFactory usually fails because the EL implementation (jakarta.el) is missing from the classpath.
- Add org.glassfish:jakarta.el (or another EL implementation) alongside the validation provider.
- Alternatively supply your own ValidatorFactory via jakarta.persistence.validation.factory in the persistence unit properties.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Building the default ValidatorFactory through Validation.buildDefaultValidatorFactory() fails.
Common situations: A Validation provider is present but misconfigured (broken validation.xml, missing EL implementation, or conflicting provider jars).
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/36a3625509f1a33d.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/boot/beanvalidation/TypeSafeActivator.java:676
final var providedFactory =
resolveProvidedFactory( context.getSessionFactory().getSessionFactoryOptions() );
if ( providedFactory != null ) {
return providedFactory;
}
// 2 - look in ConfigurationService
final var configuredFactory =
resolveProvidedFactory( context.getServiceRegistry().requireService( ConfigurationService.class ) );
if ( configuredFactory != null ) {
return configuredFactory;
}
// 3 - build our own
try {
return Validation.buildDefaultValidatorFactory();
}
catch ( Exception e ) {
throw new IntegrationException( "Unable to build the default ValidatorFactory", e );
}
}
private static ValidatorFactory resolveProvidedFactory(SessionFactoryOptions options) {
final Object validatorFactoryReference = options.getValidatorFactoryReference();
if ( validatorFactoryReference == null ) {
return null;
}
else if ( validatorFactoryReference instanceof ValidatorFactory result ) {
return result;
}
else {
throw new IntegrationException(
String.format(
Locale.ENGLISH,
"ValidatorFactory reference (provided via %s) was not castable to %s : %s",
SessionFactoryOptions.class.getName(),
ValidatorFactory.class.getName(),View on GitHub (pinned to fad1729dce)