{"record":{"id":"31b1d7e18eef3b85","repo":"quarkusio/quarkus","slug":"class-of-nested-annotation-missing","errorCode":null,"errorMessage":"Class of nested annotation  missing","messagePattern":"Class of nested annotation  missing","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AnnotationLiteralProcessor.java","lineNumber":168,"sourceCode":"            case ENUM -> {\n                ClassDesc enumDesc = classDescOf(annotationMemberValue.asEnumType());\n                yield bc.getStaticField(FieldDesc.of(enumDesc, annotationMemberValue.asEnum(), enumDesc));\n            }\n            case CLASS -> {\n                if (annotationMemberValue.equals(annotationMember.defaultValue())) {\n                    yield bc.getStaticField(FieldDesc.of(ClassDesc.of(literal.generatedClassName),\n                            AnnotationLiteralGenerator.defaultValueStaticFieldName(annotationMember),\n                            classDescOf(annotationMember.returnType())));\n                } else {\n                    yield Const.of(classDescOf(annotationMemberValue.asClass()));\n                }\n            }\n            case NESTED -> {\n                AnnotationInstance nestedAnnotation = annotationMemberValue.asNested();\n                DotName annotationName = nestedAnnotation.name();\n                ClassInfo annotationClass = beanArchiveIndex.getClassByName(annotationName);\n                if (annotationClass == null) {\n                    throw new IllegalStateException(\"Class of nested annotation \" + nestedAnnotation + \" missing\");\n                }\n                yield create(bc, annotationClass, nestedAnnotation);\n            }\n            case ARRAY -> {\n                AnnotationValue.Kind componentKind = annotationMemberValue.componentKind();\n                yield switch (componentKind) {\n                    case BOOLEAN -> {\n                        boolean[] booleanArray = annotationMemberValue.asBooleanArray();\n                        Expr[] exprArray = new Expr[booleanArray.length];\n                        for (int i = 0; i < booleanArray.length; i++) {\n                            exprArray[i] = Const.of(booleanArray[i]);\n                        }\n                        yield bc.newArray(boolean.class, exprArray);\n                    }\n                    case BYTE -> {\n                        byte[] byteArray = annotationMemberValue.asByteArray();\n                        Expr[] exprArray = new Expr[byteArray.length];\n                        for (int i = 0; i < byteArray.length; i++) {","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AnnotationLiteralProcessor.java#L150-L186","documentation":"While loading NESTED annotation member values for a generated literal, Arc must resolve the nested annotation's ClassInfo from the bean archive index. If getClassByName returns null, IllegalStateException 'Class of nested annotation ... missing' is thrown.","triggerScenarios":"An annotation member of nested-annotation type whose annotation class is absent from the bean archive index, resolved in loadValue's NESTED case.","commonSituations":"Nested annotation types living in jars not indexed by Jandex; missing jandex.idx; annotation class in a module not visible to the archive index.","solutions":["Index the jar containing the nested annotation type","Ensure the nested annotation class is a dependency of the bean archive","Regenerate the Jandex index after adding the dependency"],"exampleFix":"// before\n// nested annotation class not indexed\n// after\n// add jandex plugin / META-INF/jandex.idx to the module declaring the nested annotation","handlingStrategy":"validation","validationCode":"if (index.getClassByName(DotName.createSimple(NestedAnno.class.getName())) == null) throw new IllegalStateException(\"not indexed\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Index nested annotation modules"],"tags":["arc","cdi","jandex","nested-annotation"],"backgroundTag":"class-not-in-jandex-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"}