{"record":{"id":"c8f043717d88cf24","repo":"quarkusio/quarkus","slug":"failed-to-index-classname-class-not-present-i-c8f043","errorCode":null,"errorMessage":"Failed to index: ${className}, class not present in class loader: ${classLoader}","messagePattern":"Failed to index: (.+?), class not present in class loader: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/index/LazyIndexer.java","lineNumber":146,"sourceCode":"            Collections.sort(current);\n\n            for (String className : current) {\n                if (alreadySeen.contains(className)) {\n                    continue;\n                }\n\n                byte[] classData = classesData.get(className);\n\n                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();","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/index/LazyIndexer.java#L128-L164","documentation":"During LazyIndexer.complete(), classes recorded earlier are now actually indexed. If a class is absent from the existing index, Quarkus tries to read its bytes from the given class loader; when that yields no stream at all it throws this IllegalStateException naming both the class and the class loader. It means a class was promised to the indexer but cannot be found anywhere.","triggerScenarios":"A class name was added to the LazyIndexer during bytecode processing, but at complete() time the class is neither in the existing index nor loadable via IoUtil.readClass(classLoader, className) — the resource bytes are simply not there.","commonSituations":"Class comes from an optional/conditional dependency that is not on the augmentation classpath; a class generated at build time was removed or renamed; class name uses wrong form (internal vs binary) so the resource lookup misses; wrong class loader passed to the indexer.","solutions":["Add the dependency that actually contains the named class to the deployment/runtime classpath","Verify the class name is a binary name (dots, not slashes) and that the class file exists at the expected resource path in its jar","Check that the class loader handed to the indexer includes the application classes (Quarkus augmentation class loader)","If the class is build-time generated, ensure it is generated before the indexing step runs"],"exampleFix":"// before\n<dependency>\n  <groupId>com.acme</groupId><artifactId>acme-optional-model</artifactId>\n  <optional>true</optional>\n</dependency>\n// after\n<dependency>\n  <groupId>com.acme</groupId><artifactId>acme-optional-model</artifactId>\n  <optional>false</optional>\n</dependency>","handlingStrategy":"validation","validationCode":"// Verify the class is resolvable before indexing\nString resource = className.replace('.', '/') + \".class\";\nboolean present = classLoader.getResource(resource) != null;\nif (!present) {\n    throw new IllegalStateException(\"Class \" + className + \" not found in \" + classLoader);\n}","typeGuard":null,"tryCatchPattern":"try {\n    IndexingUtil.indexClass(className, indexer, quarkusIndex, additionalIndex, knownMissingClasses, classLoader);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"class not present in class loader\")) {\n        log.warnf(\"Dropping index request for %s: dependency missing from augmentation classpath\", className);\n        return;\n    }\n    throw e;\n}","preventionTips":["Make optional dependencies of indexed classes non-optional, or guard indexing on their presence","Always pass binary class names (dots), not internal names","Ensure generated classes exist before the indexing/augmentation step","Confirm the augmentation class loader includes application classes"],"tags":["quarkus","indexing","classpath","classloader","missing-class"],"backgroundTag":"class-not-found-on-classpath","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"}