{"record":{"id":"36a3625509f1a33d","repo":"hibernate/hibernate-orm","slug":"unable-to-build-the-default-validatorfactory","errorCode":null,"errorMessage":"Unable to build the default ValidatorFactory","messagePattern":"Unable to build the default ValidatorFactory","errorType":"exception","errorClass":"IntegrationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/beanvalidation/TypeSafeActivator.java","lineNumber":676,"sourceCode":"\t\tfinal var providedFactory =\n\t\t\t\tresolveProvidedFactory( context.getSessionFactory().getSessionFactoryOptions() );\n\t\tif ( providedFactory != null ) {\n\t\t\treturn providedFactory;\n\t\t}\n\n\t\t// 2 - look in ConfigurationService\n\t\tfinal var configuredFactory =\n\t\t\t\tresolveProvidedFactory( context.getServiceRegistry().requireService( ConfigurationService.class ) );\n\t\tif ( configuredFactory != null ) {\n\t\t\treturn configuredFactory;\n\t\t}\n\n\t\t// 3 - build our own\n\t\ttry {\n\t\t\treturn Validation.buildDefaultValidatorFactory();\n\t\t}\n\t\tcatch ( Exception e ) {\n\t\t\tthrow new IntegrationException( \"Unable to build the default ValidatorFactory\", e );\n\t\t}\n\t}\n\n\tprivate static ValidatorFactory resolveProvidedFactory(SessionFactoryOptions options) {\n\t\tfinal Object validatorFactoryReference = options.getValidatorFactoryReference();\n\t\tif ( validatorFactoryReference == null ) {\n\t\t\treturn null;\n\t\t}\n\t\telse if ( validatorFactoryReference instanceof ValidatorFactory result ) {\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new IntegrationException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ENGLISH,\n\t\t\t\t\t\t\t\"ValidatorFactory reference (provided via %s) was not castable to %s : %s\",\n\t\t\t\t\t\t\tSessionFactoryOptions.class.getName(),\n\t\t\t\t\t\t\tValidatorFactory.class.getName(),","sourceCodeStart":658,"sourceCodeEnd":694,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/beanvalidation/TypeSafeActivator.java#L658-L694","documentation":"Error \"Unable to build the default ValidatorFactory\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Building the default ValidatorFactory through Validation.buildDefaultValidatorFactory() fails.","commonSituations":"A Validation provider is present but misconfigured (broken validation.xml, missing EL implementation, or conflicting provider jars).","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}