{"record":{"id":"571a6368d8727aa8","repo":"grpc/grpc-java","slug":"no-entry-in-descriptor-matching-bound-method-ful","errorCode":null,"errorMessage":"No entry in descriptor matching bound method ${fullMethodName}","messagePattern":"No entry in descriptor matching bound method (.+?)","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/io/grpc/ServerServiceDefinition.java","lineNumber":147,"sourceCode":"        }\n        serviceDescriptor = new ServiceDescriptor(serviceName, methodDescriptors);\n      }\n      Map<String, ServerMethodDefinition<?, ?>> tmpMethods = new HashMap<>(methods);\n      for (MethodDescriptor<?, ?> descriptorMethod : serviceDescriptor.getMethods()) {\n        ServerMethodDefinition<?, ?> removed = tmpMethods.remove(\n            descriptorMethod.getFullMethodName());\n        if (removed == null) {\n          throw new IllegalStateException(\n              \"No method bound for descriptor entry \" + descriptorMethod.getFullMethodName());\n        }\n        if (removed.getMethodDescriptor() != descriptorMethod) {\n          throw new IllegalStateException(\n              \"Bound method for \" + descriptorMethod.getFullMethodName()\n                  + \" not same instance as method in service descriptor\");\n        }\n      }\n      if (tmpMethods.size() > 0) {\n        throw new IllegalStateException(\n            \"No entry in descriptor matching bound method \"\n                + tmpMethods.values().iterator().next().getMethodDescriptor().getFullMethodName());\n      }\n      return new ServerServiceDefinition(serviceDescriptor, methods);\n    }\n  }\n}\n","sourceCodeStart":129,"sourceCodeEnd":155,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/api/src/main/java/io/grpc/ServerServiceDefinition.java#L129-L155","documentation":"ServerServiceDefinition.Builder.build() checks that every method bound with addMethod() has a matching entry in the ServiceDescriptor. If bound methods remain that have no corresponding descriptor entry, this IllegalStateException is thrown, reporting the first unmatched bound method's full name.","triggerScenarios":"Calling build() after addMethod() with a MethodDescriptor whose full method name does not appear in the builder's ServiceDescriptor — e.g. adding a method the service descriptor doesn't declare, or a ServiceDescriptor built before all methods were added.","commonSituations":"Manually wiring a server service definition where the ServiceDescriptor was created from a stale/partial method list; adding streaming methods to the builder but forgetting to include them in the descriptor; mismatched service names between the method and descriptor.","solutions":["Ensure the ServiceDescriptor passed to the builder declares every method you add with addMethod()","Rebuild the ServiceDescriptor from the complete set of bound MethodDescriptors","Verify full method names (service name + method name) match exactly between bound methods and descriptor entries","If generating code, regenerate so descriptor and bound methods stay in sync"],"exampleFix":"// before\nServiceDescriptor desc = ServiceDescriptor.newBuilder(\"svc\").build(); // missing method\nbuilder = ServerServiceDefinition.builder(desc).addMethod(barMethod);\n// after\nServiceDescriptor desc = ServiceDescriptor.newBuilder(\"svc\")\n    .addMethod(barMethod)\n    .build();\nServerServiceDefinition def = ServerServiceDefinition.builder(desc).addMethod(barMethod).build();","handlingStrategy":"validation","validationCode":"Set<String> descNames = descriptor.getMethods().stream().map(MethodDescriptor::getFullMethodName).collect(toSet());\nassert boundMethods.stream().map(MethodDescriptor::getFullMethodName).allMatch(descNames::contains);","typeGuard":null,"tryCatchPattern":"try {\n  def = builder.build();\n} catch (IllegalStateException e) {\n  throw new ConfigurationException(\"Bound method missing from descriptor: \" + e.getMessage(), e);\n}","preventionTips":["Build the ServiceDescriptor from the full list of bound methods, never a hand-maintained list","Keep method registration in one place to avoid drift between builder and descriptor","Write a test that builds every service definition at startup"],"tags":["grpc","rpc","descriptor","mismatch"],"backgroundTag":"internal-invariant-violation","analyzedSha":"64daddc1f3d1975670f769f3e97bde8b2ba32d25","analyzedAt":"2026-09-08T06:14:57.704Z","contentChangedAt":"2026-09-08T06:14:57.704Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}