{"record":{"id":"8fcbc34169fdd00f","repo":"quarkusio/quarkus","slug":"interceptor-has-no-bindings","errorCode":null,"errorMessage":"Interceptor has no bindings: ","messagePattern":"Interceptor has no bindings: ","errorType":"validation","errorClass":"DefinitionException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Interceptors.java","lineNumber":55,"sourceCode":"    static InterceptorInfo createInterceptor(ClassInfo interceptorClass, BeanDeployment beanDeployment,\n            InjectionPointModifier transformer) {\n        Integer priority = null;\n        for (AnnotationInstance annotation : beanDeployment.getAnnotations(interceptorClass)) {\n            if (annotation.name().equals(DotNames.PRIORITY)) {\n                priority = annotation.value().asInt();\n            }\n            // rudimentary, but good enough for now (should also look at inherited annotations and stereotypes)\n            ScopeInfo scope = beanDeployment.getScope(annotation.name());\n            if (scope != null && !BuiltinScope.DEPENDENT.is(scope)) {\n                throw new DefinitionException(\"Interceptor declares scope other than @Dependent: \" + interceptorClass);\n            }\n        }\n\n        Set<AnnotationInstance> bindings = new HashSet<>();\n        addBindings(beanDeployment, interceptorClass, bindings, false);\n\n        if (bindings.isEmpty()) {\n            throw new DefinitionException(\"Interceptor has no bindings: \" + interceptorClass);\n        }\n\n        if (priority == null) {\n            if (beanDeployment.strictCompatibility) {\n                // interceptor without `@Priority` is disabled per the specification\n                return null;\n            }\n\n            LOGGER.info(\"The interceptor \" + interceptorClass + \" does not declare any @Priority. \" +\n                    \"It will be assigned a default priority value of 0.\");\n            priority = 0;\n        }\n\n        checkClassLevelInterceptorBindings(bindings, interceptorClass, beanDeployment);\n        checkInterceptorFieldsAndMethods(interceptorClass, beanDeployment);\n\n        return new InterceptorInfo(interceptorClass, beanDeployment,\n                bindings.size() == 1 ? Set.of(bindings.iterator().next())","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Interceptors.java#L37-L73","documentation":"ArC throws this DefinitionException when an @Interceptor class declares no interceptor binding annotations (@InterceptorBinding-annotated annotation types). Every interceptor must bind to at least one binding annotation so it can be matched to intercepted beans. Raised at build time during interceptor creation; the application fails to deploy.","triggerScenarios":"Declaring a class with @Interceptor but no binding annotation (e.g. missing @Logged); the binding annotation accidentally losing its @InterceptorBinding meta-annotation; the binding annotation on a superclass rather than the interceptor class itself when addBindings with inherited=false finds none.","commonSituations":"Creating a new interceptor and forgetting the binding annotation; renaming the binding annotation so it is no longer meta-annotated with @InterceptorBinding; removing the binding during refactoring while keeping @Interceptor.","solutions":["Add an interceptor binding annotation (one meta-annotated with @InterceptorBinding) to the interceptor class.","Verify the binding annotation itself is meta-annotated with @InterceptorBinding and @Retention(RUNTIME).","Remove the @Interceptor annotation entirely if the class is not meant to be an interceptor."],"exampleFix":"// before\n@Interceptor\n@Priority(100)\nclass LoggingInterceptor { }\n// after\n@Interceptor\n@Priority(100)\n@Logged\nclass LoggingInterceptor { }","handlingStrategy":"validation","validationCode":"boolean hasBinding = java.util.Arrays.stream(LoggingInterceptor.class.getAnnotations())\n    .anyMatch(a -> a.annotationType().isAnnotationPresent(jakarta.interceptor.InterceptorBinding.class));\nif (!hasBinding) throw new IllegalStateException(\"Interceptor must declare at least one @InterceptorBinding\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair every @Interceptor with at least one binding annotation meta-annotated with @InterceptorBinding","Ensure binding annotations use @Retention(RUNTIME)","If the class is not an interceptor, remove @Interceptor rather than leaving it binding-less"],"tags":["cdi","quarkus","arc","interceptor","interceptor-binding"],"backgroundTag":"missing-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"}