{"record":{"id":"cfb792104d38e129","repo":"quarkusio/quarkus","slug":"annotation-class-not-available","errorCode":null,"errorMessage":"Annotation class not available: ","messagePattern":"Annotation class not available: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AnnotationLiteralProcessor.java","lineNumber":91,"sourceCode":"     * have to check (and will get decent errors for free), but callers that can possibly deal\n     * with class-retained annotations or missing annotation classes must check explicitly.\n     * <p>\n     * We call the generated implementation of the annotation type an <em>annotation literal class</em>\n     * and the instance produced by the generated bytecode an <em>annotation literal instance</em>,\n     * even though the generated code doesn't use CDI's {@code AnnotationLiteral}.\n     *\n     * @param bc will receive the bytecode sequence for instantiating the annotation literal class\n     *        as a sequence of {@link BlockCreator} method calls\n     * @param annotationClass the annotation type\n     * @param annotationInstance the annotation instance; must match the {@code annotationClass}\n     * @return an annotation literal instance result handle\n     */\n    public Expr create(BlockCreator bc, ClassInfo annotationClass, AnnotationInstance annotationInstance) {\n        if (!annotationInstance.runtimeVisible()) {\n            throw new IllegalArgumentException(\"Annotation does not have @Retention(RUNTIME): \" + annotationInstance);\n        }\n        if (annotationClass == null) {\n            throw new IllegalArgumentException(\"Annotation class not available: \" + annotationInstance);\n        }\n\n        AnnotationLiteralClassInfo literal = cache.getValue(new CacheKey(annotationClass));\n\n        ClassDesc generatedClass = ClassDesc.of(literal.generatedClassName);\n\n        if (literal.annotationMembers().isEmpty()) {\n            return bc.getStaticField(FieldDesc.of(generatedClass, \"INSTANCE\", generatedClass));\n        }\n\n        Expr[] ctorArgs = new Expr[literal.annotationMembers().size()];\n        int argIndex = 0;\n        for (MethodInfo annotationMember : literal.annotationMembers()) {\n            AnnotationValue value = annotationInstance.value(annotationMember.name());\n            if (value == null) {\n                value = annotationMember.defaultValue();\n            }\n            if (value == null) {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AnnotationLiteralProcessor.java#L73-L109","documentation":"AnnotationLiteralProcessor.create requires the Jandex ClassInfo for the annotation to generate the literal. When the annotation class is absent from the bean archive index (null ClassInfo), an IllegalArgumentException naming the annotation instance is thrown.","triggerScenarios":"Invoking create() for an annotation whose DotName cannot be resolved to ClassInfo in the supplied bean archive index.","commonSituations":"Dependencies not indexed by Jandex (missing jandex index or META-INF/jandex.idx); annotation types in un-indexed third-party jars; stale/incorrect Jandex version producing incomplete indexes.","solutions":["Index the dependency containing the annotation (add jandex-maven-plugin or a META-INF/jandex.idx)","Ensure the annotation type is on the bean archive index path","Verify the Jandex index is regenerated after dependency changes"],"exampleFix":"// before\n<plugin> <groupId>org.jboss.jandex</groupId> <artifactId>jandex-maven-plugin</artifactId> <skip>true</skip> </plugin>\n// after\n<plugin> <groupId>org.jboss.jandex</groupId> <artifactId>jandex-maven-plugin</artifactId> <executions> <execution> <goals><goal>jandex</goal></goals> </execution> </executions> </plugin>","handlingStrategy":"validation","validationCode":"if (index.getClassByName(DotName.createSimple(MyAnno.class.getName())) == null) throw new IllegalStateException(\"not indexed\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Jandex indexes current"],"tags":["arc","cdi","jandex","index"],"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-14T00:17:10.932Z"}