{"record":{"id":"303423839a74423a","repo":"hibernate/hibernate-orm","slug":"unable-to-locate-typesafeactivator-activate-method","errorCode":null,"errorMessage":"Unable to locate TypeSafeActivator#activate method","messagePattern":"Unable to locate TypeSafeActivator#activate method","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/beanvalidation/BeanValidationIntegrator.java","lineNumber":118,"sourceCode":"\t\tif ( modes.size() > 1 ) {\n\t\t\tBEAN_VALIDATION_LOGGER.multipleValidationModes( ValidationMode.loggable( modes ) );\n\t\t}\n\t\tactivate( metadata, sessionFactory, serviceRegistry, modes, constraintInfluence );\n\t}\n\n\tprivate void activate(Metadata metadata, SessionFactoryImplementor sessionFactory, ServiceRegistryImplementor serviceRegistry, Set<ValidationMode> modes, ValidationConstraintDdlInfluence constraintInfluence) {\n\t\tfinal var classLoaderService = serviceRegistry.requireService( ClassLoaderService.class );\n\t\t// see if the Bean Validation API is available on the classpath\n\t\tif ( isBeanValidationApiAvailable( classLoaderService ) ) {\n\t\t\t// and if so, call out to the TypeSafeActivator\n\t\t\ttry {\n\t\t\t\tfinal var activationContext =\n\t\t\t\t\t\tnew ActivationContextImpl( modes, constraintInfluence, metadata, sessionFactory,\n\t\t\t\t\t\t\t\t(SessionFactoryServiceRegistry) serviceRegistry );\n\t\t\t\tcallActivateMethod( classLoaderService, activationContext );\n\t\t\t}\n\t\t\tcatch (NoSuchMethodException e) {\n\t\t\t\tthrow new HibernateException( \"Unable to locate TypeSafeActivator#activate method\", e );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// otherwise check the validation modes\n\t\t\t// todo : in many ways this duplicates the checks done on the TypeSafeActivator when a ValidatorFactory could not be obtained\n\t\t\tvalidateMissingBeanValidationApi( modes, constraintInfluence );\n\t\t}\n\t}\n\n\tprivate void callActivateMethod(ClassLoaderService classLoaderService, ActivationContext activationContext)\n\t\t\tthrows NoSuchMethodException {\n\t\tfinal var activateMethod =\n\t\t\t\tloadTypeSafeActivatorClass( classLoaderService )\n\t\t\t\t\t\t.getMethod( ACTIVATE_METHOD_NAME, ActivationContext.class );\n\t\ttry {\n\t\t\tactivateMethod.invoke( null, activationContext );\n\t\t}\n\t\tcatch (InvocationTargetException e) {","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/beanvalidation/BeanValidationIntegrator.java#L100-L136","documentation":"The Bean Validation API was detected as available and TypeSafeActivator loaded, but the reflective lookup of activate(ActivationContext) threw NoSuchMethodException: the activator class on the classpath does not match the shape the driving BeanValidationIntegrator expects — the signature of a different Hibernate version.","triggerScenarios":"SessionFactory bootstrap with validation active (CALLBACK/AUTO) while mismatched hibernate-core artifacts coexist, so the loaded TypeSafeActivator lacks the activate(ActivationContext) method the integrator is calling.","commonSituations":"Version drift after upgrading hibernate-core but leaving a stale or shaded copy behind; frameworks pulling hibernate-core transitively at a different version than the one on the classpath.","solutions":["Deduplicate hibernate-core: dependency:tree / gradle dependencies, then enforce a single version","If shading, rebuild the shaded artifact against the current Hibernate version","On platforms like WildFly/Quarkus, use the Hibernate provided by the platform and remove explicit hibernate-core dependencies"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// same dedupe guard that prevents the method-lookup variant\nstatic void assertSingleHibernateCore() throws IOException {\n    Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(\n        \"org/hibernate/boot/beanvalidation/BeanValidationIntegrator.class\");\n    if (Collections.list(urls).size() > 1)\n        throw new IllegalStateException(\"Multiple hibernate-core copies; align versions\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    sessionFactory = new Configuration().buildSessionFactory();\n} catch (HibernateException e) {\n    if (e.getCause() instanceof NoSuchMethodException)\n        throw new IllegalStateException(\"hibernate-core version mix-up: duplicate artifacts present\", e);\n    throw e;\n}","preventionTips":["Upgrade hibernate-core as a whole, never mix jars of different versions","Let the platform (Boot/WildFly/Quarkus) manage the Hibernate version"],"tags":["hibernate","dependency-conflict","bean-validation","version-mismatch","nosuchmethod"],"backgroundTag":"dependency-version-conflict","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}