{"record":{"id":"ece3c11cd800b014","repo":"quarkusio/quarkus","slug":"unable-to-instantiate-integrator-integratorclass","errorCode":null,"errorMessage":"Unable to instantiate integrator <integratorClass>","messagePattern":"Unable to instantiate integrator <integratorClass>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/FastBootMetadataBuilder.java","lineNumber":493,"sourceCode":"\n    private Dialect extractDialect() {\n        DialectFactory service = standardServiceRegistry.getService(DialectFactory.class);\n        QuarkusStaticInitDialectFactory casted = (QuarkusStaticInitDialectFactory) service;\n        return casted.getDialect();\n    }\n\n    private Collection<Integrator> getIntegrators() {\n        LinkedHashSet<Integrator> integrators = new LinkedHashSet<>();\n        if (isHibernateValidatorPresent) {\n            integrators.add(new BeanValidationIntegrator());\n        }\n        integrators.add(new CollectionCacheInvalidator());\n\n        for (Class<? extends Integrator> integratorClass : additionalIntegrators) {\n            try {\n                integrators.add(integratorClass.getConstructor().newInstance());\n            } catch (Exception e) {\n                throw new IllegalArgumentException(\"Unable to instantiate integrator \" + integratorClass, e);\n            }\n        }\n\n        return integrators;\n    }\n\n    @SuppressWarnings(\"rawtypes\")\n    private static class MergedSettings {\n        private final Map configurationValues = new ConcurrentHashMap(16, 0.75f, 1);\n        private List<CacheRegionDefinition> cacheRegionDefinitions;\n\n        private MergedSettings() {\n        }\n\n        public Map getConfigurationValues() {\n            return configurationValues;\n        }\n","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/FastBootMetadataBuilder.java#L475-L511","documentation":"FastBootMetadataBuilder collects additional Hibernate Integrator classes supplied via configuration (hibernate.integrator.provider / additional integrators) and instantiates them reflectively with a no-arg constructor. If instantiation fails (missing public no-arg constructor, exception in constructor, or class init failure), the builder wraps the cause in this IllegalArgumentException.","triggerScenarios":"Configuring an integrator class via quarkus.hibernate.orm.additional-integrators (or pu-level equivalent) whose class lacks a public no-argument constructor, throws in its constructor, or fails static initialization when getConstructor().newInstance() is called.","commonSituations":"Typos in the integrator class name that resolve to another class; integrators written with constructor dependencies (DI) that plain reflective instantiation cannot satisfy; integrator constructors throwing because Quarkus services aren't available yet at static-init time.","solutions":["Give the integrator a public no-argument constructor.","Check the nested 'Caused by' for the real failure (constructor exception, NoClassDefFoundError, etc.).","Register the integrator via an extension build step (AdditionalJaxbMappingBuildItem / integrator build item) instead of reflective instantiation.","Ensure the integrator class is on the runtime classpath and its dependencies are present (e.g., mark beans @Injectable or avoid DI inside the constructor)."],"exampleFix":"// before\npublic class MyIntegrator implements Integrator {\n    public MyIntegrator(SomeService svc) { ... } // no no-arg ctor\n}\n// after\npublic class MyIntegrator implements Integrator {\n    public MyIntegrator() { } // reflectively instantiable\n    @Override public void integrate(...) { ... }\n}","handlingStrategy":"validation","validationCode":"static <T extends Integrator> void validateIntegrator(Class<T> c) throws Exception {\n    c.getConstructor(); // throws NoSuchMethodException early if no public no-arg ctor\n    c.getDeclaredConstructor().newInstance(); // surface ctor exceptions before boot\n}","typeGuard":null,"tryCatchPattern":"try {\n    integratorClass.getConstructor().newInstance();\n} catch (IllegalArgumentException e) {\n    log.error(\"Integrator \" + integratorClass + \" must have a public no-arg constructor\", e.getCause());\n}","preventionTips":["Always give integrators a public no-arg constructor","Avoid DI/CDI inside integrator constructors","Check 'Caused by' when integrator boot fails","Prefer build-step registration over string-configured integrators"],"tags":["hibernate-orm","reflection","integrator","instantiation"],"backgroundTag":"reflective-instantiation-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}