hibernate/hibernate-orm · error · IntegrationException

Unable to build the default ValidatorFactory

Error message

Unable to build the default ValidatorFactory

What it means

Error "Unable to build the default ValidatorFactory" thrown in hibernate/hibernate-orm.

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)

Solutions

  1. Inspect the root cause exception in the log; the default ValidatorFactory usually fails because the EL implementation (jakarta.el) is missing from the classpath.
  2. Add org.glassfish:jakarta.el (or another EL implementation) alongside the validation provider.
  3. Alternatively supply your own ValidatorFactory via jakarta.persistence.validation.factory in the persistence unit properties.

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.