{"record":{"id":"d3dea496bf57dfb6","repo":"quarkusio/quarkus","slug":"a-grpc-service-injection-is-missing-the-grpcclien","errorCode":null,"errorMessage":"A gRPC service injection is missing the @GrpcClient qualifier: ${class}#${field}","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":321,"sourceCode":"    }\n\n    @BuildStep\n    public void validateInjectedServiceInterfaces(CombinedIndexBuildItem index,\n            // Dummy producer - this build step needs to be executed before the CDI container is initialized\n            BuildProducer<UnremovableBeanBuildItem> dummy) {\n        // Attempt to detect wrong service interface injection points\n        // Note that we cannot use injection points metadata because the build can fail with unsatisfied dependency before\n        Set<DotName> serviceInterfaces = new HashSet<>();\n        for (ClassInfo serviceInterface : index.getIndex().getKnownDirectImplementors(GrpcDotNames.MUTINY_SERVICE)) {\n            serviceInterfaces.add(serviceInterface.name());\n        }\n\n        for (AnnotationInstance injectAnnotation : index.getIndex().getAnnotations(DotNames.INJECT)) {\n            if (injectAnnotation.target().kind() == Kind.FIELD) {\n                FieldInfo field = injectAnnotation.target().asField();\n                if (serviceInterfaces.contains(field.type().name()) && field.annotations().size() == 1) {\n                    // e.g. @Inject Greeter\n                    throw new IllegalStateException(\"A gRPC service injection is missing the @GrpcClient qualifier: \"\n                            + 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) {","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcClientProcessor.java#L303-L339","documentation":"A field of a gRPC service interface type is annotated only with @Inject (no @GrpcClient qualifier). Quarkus-generated clients require @GrpcClient to disambiguate which configured client/service to inject; an unqualified injection cannot be resolved, so deployment fails.","triggerScenarios":"A field whose type is a known gRPC service interface has exactly one annotation (@Inject) and no @GrpcClient, e.g. @Inject Greeter greeter; during validateInjectedServiceInterfaces.","commonSituations":"Following generic CDI examples that omit qualifiers; migrating from other gRPC frameworks; IDE auto-completing @Inject only; removing @GrpcClient during cleanup.","solutions":["Add the @GrpcClient qualifier: @Inject @GrpcClient(\"hello-service\") Greeter greeter;","If using the generated Mutiny bean, still add @GrpcClient to name/qualify the client","Check all @Inject fields typed as .proto service interfaces"],"exampleFix":"// before\n@Inject Greeter greeter;\n\n// after\n@Inject @GrpcClient(\"hello-service\") Greeter greeter;","handlingStrategy":"validation","validationCode":"// every gRPC service injection needs the qualifier\n@Inject @GrpcClient(\"hello-service\") Greeter greeter; // correct pattern to copy","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair @Inject with @GrpcClient for .proto service interface fields","Grep for @Inject on service-interface types during code review","Add an ArchUnit/checkstyle rule if the mistake recurs"],"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"}