{"record":{"id":"d1a646efc74b396b","repo":"quarkusio/quarkus","slug":"class-not-in-index","errorCode":null,"errorMessage":"Class not in index: ","messagePattern":"Class not in index: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/FaultToleranceMethodSearch.java","lineNumber":141,"sourceCode":"        // this is to satisfy the specification, which says: fallback method must be on the same class, a superclass\n        // or an implemented interface of the class which declares the annotated method\n        //\n        // we fake this by checking that the matching method has the same name as one of the method declared on\n        // the declaring class or any of its superclasses or any of its implemented interfaces (this is actually\n        // quite precise, the only false positive would occur in presence of overloads)\n        Set<String> declaredMethodNames = findDeclaredMethodNames(declaringClass);\n\n        Deque<ClassWithTypeMapping> worklist = new ArrayDeque<>();\n        {\n            // add all superclasses first, so that they're preferred\n            // interfaces are added during worklist iteration\n            ClassInfo clazz = beanClass;\n            TypeMapping typeMapping = new TypeMapping();\n            worklist.add(new ClassWithTypeMapping(clazz, typeMapping));\n            while (clazz.superName() != null) {\n                ClassInfo superclass = index.getClassByName(clazz.superName());\n                if (superclass == null) {\n                    throw new IllegalArgumentException(\"Class not in index: \" + clazz.superName());\n                }\n                Type genericSuperclass = clazz.superClassType();\n                typeMapping = typeMapping.getDirectSupertypeMapping(superclass, genericSuperclass);\n                worklist.add(new ClassWithTypeMapping(superclass, typeMapping));\n\n                clazz = superclass;\n            }\n        }\n        while (!worklist.isEmpty()) {\n            ClassWithTypeMapping classWithTypeMapping = worklist.removeFirst();\n            ClassInfo clazz = classWithTypeMapping.clazz;\n            TypeMapping actualMapping = classWithTypeMapping.typeMapping;\n\n            Set<MethodInfo> methods = getMethodsFromClass(clazz, name, expectedParameterTypes, expectedReturnType,\n                    expectedExceptionParameter, declaringClass, actualMapping, expectedMapping);\n            for (MethodInfo method : methods) {\n                if (declaredMethodNames.contains(method.name())) {\n                    result.add(method);","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/FaultToleranceMethodSearch.java#L123-L159","documentation":"FaultToleranceMethodSearch.findMethod walks a class's superclass chain in the Jandex index to resolve fault-tolerance methods (including generic type mappings). When a superclass in the chain is not present in the application's bean archive index, the build step cannot resolve the type mapping and throws IllegalArgumentException 'Class not in index: <name>'. This is a deployment-time (build) failure, not a runtime exception.","triggerScenarios":"A @ApplicationScoped (or otherwise indexed) bean annotated with fault-tolerance annotations (@Retry, @Fallback, @CircuitBreaker, etc.) extends a superclass that is not part of any Jandex index — typically a class from an un-indexed jar, a generated class, or a JDK/non-bean class absent from the index.","commonSituations":"Depending on a plain (non-Quarkus) library jar without a Jandex META-INF/jandex.idx and without adding it via quarkus.index-dependencies; running with -Dquarkus.index-dependency misconfigured; inheritance from framework classes that were never indexed; Quarkus/SmallRye Fault Tolerance version upgrades that started indexing additional hierarchies.","solutions":["Ensure the missing superclass jar is indexed: add quarkus.index-dependency.<name>.group-id/artifact-id in application.properties, or add a META-INF/beans.xml or META-INF/jandex.idx to that jar","If the superclass comes from your code, verify the module containing it is part of the application and compiled with the Quarkus Maven/Gradle plugin so it gets indexed","Avoid annotating classes whose hierarchy includes non-indexable classes (e.g. JDK classes); move the fault-tolerance annotations to the concrete, indexed bean class","Update io.quarkus:quarkus-smallrye-fault-tolerance and smallrye-fault-tolerance to the latest patch; if a normal user class triggers this on a supported setup, file a Quarkus bug with a reproducer"],"exampleFix":"// before (application.properties)\n# dependency not indexed -> 'Class not in index: com.example.BaseService'\n// after\nquarkus.index-dependency.base.group-id=com.example\nquarkus.index-dependency.base.artifact-id=base-lib","handlingStrategy":"validation","validationCode":"// Check before build that the bean's hierarchy is indexed\norg.jboss.jandex.Index index = ...;\nClassInfo clazz = index.getClassByName(DotName.createSimple(\"com.example.MyBean\"));\nDotName superName = clazz.superName();\nif (superName != null && index.getClassByName(superName) == null) {\n    throw new IllegalStateException(\"Superclass not indexed: \" + superName\n        + \" - add quarkus.index-dependency or jandex.idx\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add quarkus.index-dependency.<name>.* entries for every third-party jar whose classes appear in bean hierarchies","Ensure library jars ship META-INF/jandex.idx (run 'java -jar jandex.jar' on them if not)","Only annotate concrete, application-owned beans with fault tolerance annotations","After dependency upgrades, rebuild from clean to catch index gaps early"],"tags":["fault-tolerance","jandex","classpath","build-time"],"backgroundTag":"class-not-in-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"}