{"record":{"id":"0bfbc3a9fe444c6d","repo":"quarkusio/quarkus","slug":"a-grpc-service-injection-is-missing-the-grpcclien-0bfbc3","errorCode":null,"errorMessage":"A gRPC service injection is missing the @GrpcClient qualifier: ${class}#${method}()","messagePattern":"A gRPC service injection is missing the @GrpcClient qualifier: (.+?)#(.+?)\\(\\)","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcClientProcessor.java","lineNumber":340,"sourceCode":"                            + field.declaringClass().name() + \"#\" + field.name());\n                }\n            } else if (injectAnnotation.target().kind() == Kind.METHOD) {\n                // CDI initializer\n                MethodInfo method = injectAnnotation.target().asMethod();\n                short position = 0;\n                for (Type param : method.parameterTypes()) {\n                    position++;\n                    if (serviceInterfaces.contains(param.name())) {\n                        // e.g. @Inject void setGreeter(Greeter greeter)\n                        Set<AnnotationInstance> annotations = new HashSet<>();\n                        for (AnnotationInstance annotation : method.annotations()) {\n                            if (annotation.target().kind() == Kind.METHOD_PARAMETER\n                                    && annotation.target().asMethodParameter().position() == position) {\n                                annotations.add(annotation);\n                            }\n                        }\n                        if (annotations.size() > 1) {\n                            throw new IllegalStateException(\"A gRPC service injection is missing the @GrpcClient qualifier: \"\n                                    + method.declaringClass().name() + \"#\" + method.name() + \"()\");\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    @BuildStep\n    InjectionPointTransformerBuildItem transformInjectionPoints() {\n        return new InjectionPointTransformerBuildItem(new InjectionPointsTransformer() {\n\n            @Override\n            public void transform(TransformationContext ctx) {\n                // If annotated with @GrpcClient and no explicit value is used, i.e. @GrpcClient(),\n                // then we need to determine the service name from the annotated element and transform the injection point\n                AnnotationInstance clientAnnotation = Annotations.find(ctx.getQualifiers(), GrpcDotNames.GRPC_CLIENT);\n                if (clientAnnotation != null && clientAnnotation.value() == null) {","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcClientProcessor.java#L322-L358","documentation":"A CDI initializer method parameter of a gRPC service interface type has multiple annotations but none is the @GrpcClient qualifier (the code counts parameter annotations and throws when >1 without a matching qualifier at that position). The injection cannot be resolved without the qualifier.","triggerScenarios":"A method parameter of type <service interface> carries annotations (e.g. @Sized, @Default or others) with size > 1 but no @GrpcClient at that parameter position, while the method itself is @Inject.","commonSituations":"Adding arbitrary qualifier annotations (@Named, custom qualifiers) to gRPC injection parameters; confusion between CDI qualifiers and @GrpcClient; copy-paste of annotated method signatures.","solutions":["Replace or complement the annotations with @GrpcClient(\"service-name\") on the parameter","Remove unrelated qualifiers that do not apply to gRPC clients","Move to field injection with @Inject @GrpcClient"],"exampleFix":"// before\n@Inject void init(@Named(\"g\") Greeter greeter) { ... }\n\n// after\n@Inject void init(@GrpcClient(\"hello-service\") Greeter greeter) { ... }","handlingStrategy":"validation","validationCode":"@Inject\nvoid init(@GrpcClient(\"hello-service\") Greeter greeter) { ... } // explicit qualifier at parameter","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not stack CDI qualifiers (@Named etc.) on gRPC client parameters","Use @GrpcClient as the sole qualifier for gRPC injections"],"tags":["grpc","cdi","missing-qualifier"],"backgroundTag":"missing-qualifier","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"}