{"record":{"id":"9ae3557a0a96f2b8","repo":"quarkusio/quarkus","slug":"failed-to-index-classname","errorCode":null,"errorMessage":"Failed to index: ${className}","messagePattern":"Failed to index: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/index/IndexingUtil.java","lineNumber":213,"sourceCode":"\n        DotName superclassName;\n        Set<DotName> annotationNames;\n\n        ClassInfo classInfo = quarkusIndex.getClassByName(classDotName);\n        if (classInfo == null) {\n            log.debugf(\"Index class: %s\", className);\n            try (InputStream stream = IoUtil.readClass(classLoader, className)) {\n                if (stream == null) {\n                    throw new IllegalStateException(\n                            \"Failed to index: \" + className + \", class not present in class loader: \" + classLoader);\n                }\n\n                ClassSummary summary = indexer.indexWithSummary(stream);\n                additionalIndex.add(summary.name());\n                superclassName = summary.superclassName();\n                annotationNames = summary.annotations();\n            } catch (Exception e) {\n                throw new IllegalStateException(\"Failed to index: \" + className, e);\n            }\n        } else {\n            // The class could be indexed by quarkus - we still need to distinguish framework classes\n            additionalIndex.add(classDotName);\n            superclassName = classInfo.superName();\n            annotationNames = classInfo.annotationsMap().keySet();\n        }\n\n        for (DotName annotationName : annotationNames) {\n            if (!additionalIndex.contains(annotationName) && quarkusIndex.getClassByName(annotationName) == null) {\n                try (InputStream annotationStream = IoUtil.readClass(classLoader, annotationName.toString())) {\n                    if (annotationStream == null) {\n                        log.debugf(\"Could not index annotation: %s (missing class or dependency)\", annotationName);\n                        knownMissingClasses.add(annotationName);\n                    } else {\n                        log.debugf(\"Index annotation: %s\", annotationName);\n                        indexClass(annotationName.toString(), indexer, quarkusIndex, additionalIndex, knownMissingClasses,\n                                classLoader);","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/index/IndexingUtil.java#L195-L231","documentation":"After successfully opening the class stream, indexClass calls indexer.indexWithSummary(stream); any exception during bytecode parsing is wrapped as IllegalStateException 'Failed to index: <className>'. This indicates malformed or unreadable class bytecode rather than a missing class.","triggerScenarios":"indexClass() reading a class file whose bytecode cannot be parsed: corrupt class file, unsupported class file version (newer JDK bytecode than the embedded ASM), or IO error mid-read.","commonSituations":"Building with classes compiled by a newer JDK than Quarkus's supported bytecode level; corrupted class output after interrupted compile; bad/instrumented bytecode from weaving agents or obfuscators.","solutions":["Compile with a supported --release/-target (check Quarkus docs for max supported class file version) and rebuild","Run ./mvnw clean to remove corrupted target/classes and recompile","Remove or disable bytecode post-processing agents/obfuscators on the failing class","Upgrade Quarkus if the class genuinely uses a newer bytecode version and you need support for it"],"exampleFix":"// before\n<properties><maven.compiler.release>99</maven.compiler.release></properties>\n// after\n<properties><maven.compiler.release>17</maven.compiler.release></properties>","handlingStrategy":"validation","validationCode":"// verify class file version before indexing\ntry (InputStream in = classLoader.getResourceAsStream(cls.replace('.','/') + \".class\")) {\n    DataInputStream d = new DataInputStream(in);\n    int magic = d.readInt();\n    d.readInt();\n    int major = d.readUnsignedShort();\n    if (magic != 0xCAFEBABE || major > 65 /* Java 21 */) throw new IllegalStateException(\"Unsupported/corrupt class file: \" + cls + \" major=\" + major);\n}","typeGuard":null,"tryCatchPattern":"try {\n    augment();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Failed to index:\") && !e.getMessage().contains(\"class not present\")) {\n        // recompile the named class with a supported -target; check cause for ASM/UnsupportedClassVersionError\n    }\n    throw e;\n}","preventionTips":["Pin maven.compiler.release to a JDK version supported by your Quarkus release","Always mvn clean after a crashed/interrupted compile","Avoid bytecode-weaving agents/obfuscators on classes Quarkus must index; if used, verify output with javap"],"tags":["jandex","indexing","bytecode"],"backgroundTag":"class-parse-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"}