{"record":{"id":"e9a7add3f3059e3a","repo":"quarkusio/quarkus","slug":"failed-to-index-classname-e9a7ad","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/LazyIndexer.java","lineNumber":155,"sourceCode":"                DotName superclassName;\n                Set<DotName> annotationNames;\n\n                ClassInfo classInfo = existingIndex.getClassByName(className);\n                if (classInfo == null) {\n                    try (InputStream stream = classData != null\n                            ? new ByteArrayInputStream(classData)\n                            : IoUtil.readClass(classLoader, className)) {\n                        if (stream == null) {\n                            throw new IllegalStateException(\"Failed to index: \" + className\n                                    + \", class not present in class loader: \" + classLoader);\n                        }\n\n                        ClassSummary summary = indexer.indexWithSummary(stream);\n                        alreadySeen.add(summary.name().toString());\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                    alreadySeen.add(className);\n                    superclassName = classInfo.superName();\n                    annotationNames = classInfo.annotationsMap().keySet();\n                }\n\n                for (DotName annotationDotName : annotationNames) {\n                    String annotationName = annotationDotName.toString();\n                    if (!alreadySeen.contains(annotationName) && existingIndex.getClassByName(annotationDotName) == null) {\n                        try (InputStream annotationStream = IoUtil.readClass(classLoader, annotationName)) {\n                            if (annotationStream == null) {\n                                missingAnnotations.add(annotationDotName);\n                            } else {\n                                next.add(annotationName);\n                            }\n                        } catch (IOException e) {\n                            throw new IllegalStateException(\"Failed to index: \" + className, e);","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/index/LazyIndexer.java#L137-L173","documentation":"LazyIndexer.complete() indexes each pending class; any Exception thrown by Javassist indexWithSummary (malformed bytecode, unsupported class file version, IO problems) is wrapped as this IllegalStateException. Unlike [94], the bytes were found but could not be parsed.","triggerScenarios":"The class bytes were successfully opened from ByteArrayInputStream(classData) or IoUtil.readClass(), but indexer.indexWithSummary(stream) threw while parsing — invalid class file format, ASM/Javassist version too old for the bytecode level, or truncated bytes.","commonSituations":"Dependency compiled with a newer JDK than the build JVM supports; corrupt jar entries; bytecode weaved/transformed by an agent or Gradle plugin into something Javassist cannot read.","solutions":["Run the build on a JDK at least as new as the class file version of the failing class","Re-download the containing jar (delete from ~/.m2 and rebuild) to fix corruption","Disable bytecode transformation plugins/agents for that dependency and rebuild","Update Quarkus, which may bundle a newer Javassist supporting the bytecode version"],"exampleFix":"// before\nJAVA_HOME=$(jdk8-home) ./mvnw install   # lib compiled with class file v61\n// after\nJAVA_HOME=$(jdk17-home) ./mvnw install","handlingStrategy":"try-catch","validationCode":"// Check the class file version is readable by the build JVM\nint major = (data[6] & 0xff) << 8 | (data[7] & 0xff);\nint maxSupported = Runtime.version().feature() + 44; // approx class file major for this JDK\nif (major > maxSupported) {\n    throw new IllegalStateException(\"Class \" + className + \" v\" + major + \" too new for this JDK\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    IndexingUtil.indexClass(className, indexer, quarkusIndex, additionalIndex, knownMissingClasses, classLoader);\n} catch (IllegalStateException e) {\n    log.errorf(e, \"Cannot index %s - cause: %s. Check JDK version vs bytecode level and jar integrity\",\n            className, e.getCause());\n    throw e;\n}","preventionTips":["Match build JDK to the newest bytecode version in your dependency tree","Verify downloaded jars (checksum/unzip -t)","Disable bytecode-transforming build plugins for problematic libs","Keep Quarkus (and its bundled Javassist) up to date"],"tags":["quarkus","indexing","javassist","bytecode"],"backgroundTag":"class-indexing-io-failure","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}