{"record":{"id":"f76705200730ca7d","repo":"quarkusio/quarkus","slug":"unable-to-find-the-bean-class-in-the-index","errorCode":null,"errorMessage":"Unable to find the bean class in the index: ","messagePattern":"Unable to find the bean class in the index: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanConfigurator.java","lineNumber":50,"sourceCode":"     * @param implClassName\n     * @param beanDeployment\n     * @param beanConsumer\n     */\n    BeanConfigurator(DotName implClassName, BeanDeployment beanDeployment, Consumer<BeanInfo> beanConsumer) {\n        super(implClassName);\n        this.consumed = new AtomicBoolean(false);\n        this.beanDeployment = beanDeployment;\n        this.beanConsumer = beanConsumer;\n    }\n\n    /**\n     * Finish the configurator. The configurator should not be modified after this method is called.\n     */\n    public void done() {\n        if (consumed.compareAndSet(false, true)) {\n            ClassInfo implClass = getClassByName(beanDeployment.getBeanArchiveIndex(), Objects.requireNonNull(implClazz));\n            if (implClass == null) {\n                throw new IllegalStateException(\"Unable to find the bean class in the index: \" + implClazz);\n            }\n\n            ScopeInfo scope = this.scope;\n            if (scope == null) {\n                scope = Beans.initStereotypeScope(stereotypes, implClass, beanDeployment);\n            }\n            if (scope == null) {\n                scope = BuiltinScope.DEPENDENT.getInfo();\n            }\n\n            String name = this.name;\n            if (name == null) {\n                name = Beans.initStereotypeName(stereotypes, implClass, beanDeployment);\n            }\n\n            Boolean alternative = this.alternative;\n            if (alternative == null) {\n                alternative = Beans.initStereotypeAlternative(stereotypes, beanDeployment);","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanConfigurator.java#L32-L68","documentation":"BeanConfigurator.done() finalizes a synthetic bean configurator. It looks up the configured implementation class (implClazz) in the bean archive index; if the class is not in any indexed bean archive it throws IllegalStateException, because Arc needs the ClassInfo (annotations, members) to build the bean metadata.","triggerScenarios":"registerSyntheticBeans()/configureSyntheticBean() with an impl class that is not indexed — the class lives in a non-bean-archive JAR, isn't in Jandex index, or the name/class mismatch (wrong DotName or class loaded but not indexed).","commonSituations":"Synthetic beans whose 'implClazz' points at a class from a library not registered as a bean archive; GraalVM/native-image index gaps; forgetting @Injectable or bean-archive marker so the class isn't indexed; refactors moving the class out of the app.","solutions":["Add the class to a bean archive / ensure it's part of the application index (add beans.xml or @QuarkusMain/app classes)","Use the actual bean class as implClazz (a class inside an indexed archive), or use creator(Class) with a BeanCreator instead of implClazz","Check the Jandex index includes the JAR (Quarkus: add the library as a dependency so it's indexed, or add index via jandex-maven-plugin)","Verify the class name (no typos, correct package) and that the class exists at deployment time"],"exampleFix":"// before\nconfigurator.implClazz(SomeLibClass.class).done(); // not indexed\n// after\nconfigurator.creator(SomeLibClassCreator.class) // BeanCreator impl, no index lookup needed\n           .done();","handlingStrategy":"validation","validationCode":"DotName name = DotName.createSimple(SomeClass.class.getName());\nif (beanDeployment.getBeanArchiveIndex().getClassByName(name) == null) {\n    throw new IllegalStateException(SomeClass.class + \" is not in a bean archive index\");\n}","typeGuard":null,"tryCatchPattern":"try { configurator.done(); }\ncatch (IllegalStateException e) { throw new DeploymentException(\"implClazz not indexed: use a bean-archive class or a BeanCreator\", e); }","preventionTips":["Use implClazz only for classes inside indexed bean archives","Prefer creator(BeanCreator) for classes from external libraries","Ensure every archive containing beans is a bean archive or added to the Jandex index"],"tags":["cdi","arc","jandex","index","synthetic-bean"],"backgroundTag":"class-not-in-bean-archive-index","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"}