{"record":{"id":"23a77ccd0718c2ce","repo":"quarkusio/quarkus","slug":"annotation-is-not-a-registered-interceptor-binding","errorCode":null,"errorMessage":"Annotation is not a registered interceptor binding: ","messagePattern":"Annotation is not a registered interceptor binding: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InterceptorBindings.java","lineNumber":58,"sourceCode":"            checkInterceptorBindingsForDuplicates(timesQualifierWasSeen);\n        }\n    }\n\n    // in various cases, specification requires to check interceptor bindings for duplicates and throw IAE\n    private static void checkInterceptorBindingsForDuplicates(Map<Class<? extends Annotation>, Integer> timesSeen) {\n        timesSeen.forEach(InterceptorBindings::checkInterceptorBindingsForDuplicates);\n    }\n\n    private static void checkInterceptorBindingsForDuplicates(Class<? extends Annotation> annClass, Integer timesSeen) {\n        if (timesSeen > 1 && !annClass.isAnnotationPresent(Repeatable.class)) {\n            throw new IllegalArgumentException(\"Interceptor binding \" + annClass\n                    + \" was used repeatedly but is not @Repeatable\");\n        }\n    }\n\n    private void verifyInterceptorBinding(Class<? extends Annotation> annotationType) {\n        if (!allInterceptorBindings.contains(annotationType.getName())) {\n            throw new IllegalArgumentException(\"Annotation is not a registered interceptor binding: \" + annotationType);\n        }\n    }\n\n    private static class TimesSeenBiFunction implements BiFunction<Class<? extends Annotation>, Integer, Integer> {\n        private static final TimesSeenBiFunction INSTANCE = new TimesSeenBiFunction();\n\n        @Override\n        public Integer apply(Class<? extends Annotation> k, Integer v) {\n            return v == null ? 1 : v + 1;\n        }\n    }\n}\n","sourceCodeStart":40,"sourceCodeEnd":71,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InterceptorBindings.java#L40-L71","documentation":"ArC maintains the set of interceptor binding annotations registered at build time. When a binding is passed to runtime APIs (verify() used by intercept() etc.), each annotation type is checked against that registry; an unregistered annotation produces IllegalArgumentException('Annotation is not a registered interceptor binding: ...'). The annotation simply isn't a CDI interceptor binding known to the container.","triggerScenarios":"Calling intercept()/Arc container binding APIs with an annotation that is not an @InterceptorBinding (e.g. plain @Qualifier, marker annotation, or a binding from an extension that wasn't processed).","commonSituations":"Passing a @Qualifier instead of an interceptor binding by mistake; the interceptor/binding lives in a library that wasn't indexed; typos or a similarly-named custom annotation; test code constructing bindings for annotations never bound to an interceptor.","solutions":["Ensure the annotation is declared @InterceptorBinding and its interceptor is a registered bean in the app","Check the annotation type you pass — use the actual interceptor binding, not a qualifier or other annotation","Verify the library defining the binding is on the app classpath and Jandex-indexed (empty beans.xml or QUARKUS index)","Remove the annotation from the binding array if it's not meant to bind interceptors"],"exampleFix":"// before\nintercept(m, new MyQualifier.Literal()); // not an interceptor binding\n// after\n@InterceptorBinding @Retention(RUNTIME) @interface Audited {}\nintercept(m, new Audited.Literal());","handlingStrategy":"validation","validationCode":"static void requireRegisteredBindings(ArcContainer c, Annotation... bindings) {\n    for (Annotation b : bindings) {\n        if (!b.annotationType().isAnnotationPresent(InterceptorBinding.class)) {\n            throw new IllegalArgumentException(b.annotationType() + \" is not an @InterceptorBinding\");\n        }\n    }\n}","typeGuard":"static boolean isInterceptorBinding(Class<? extends Annotation> a) {\n    return a.isAnnotationPresent(jakarta.interceptor.InterceptorBinding.class);\n}","tryCatchPattern":"try {\n    intercept(method, binding);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Annotation is not a registered interceptor binding\")) {\n        throw new IllegalStateException(\"Pass only registered @InterceptorBinding annotations\", e);\n    }\n    throw e;\n}","preventionTips":["Verify the annotation is meta-annotated @InterceptorBinding before passing it","Don't confuse @Qualifier with interceptor bindings","Ensure interceptors and their bindings live in indexed application packages","Add an integration test that invokes each intercept() call path once at startup"],"tags":["cdi","arc","interceptors","annotations"],"backgroundTag":"unregistered-interceptor-binding","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"}