{"record":{"id":"a6b01e44b3ea2c17","repo":"quarkusio/quarkus","slug":"annotationname-method-methodname-not-found-o","errorCode":null,"errorMessage":"${annotationName} method ${methodName} not found on ${declaringClass}","messagePattern":"(.+?) method (.+?) not found on (.+?)","errorType":"exception","errorClass":"RestClientDefinitionException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/MicroProfileRestClientEnricher.java","lineNumber":448,"sourceCode":"\n                if (paramValueMethod.parametersCount() == 0) {\n                    paramValue = methodCallCreator.invokeStaticMethod(paramValueMethod);\n                } else if (paramValueMethod.parametersCount() == 1 && isString(paramValueMethod.parameterType(0))) {\n                    paramValue = methodCallCreator.invokeStaticMethod(paramValueMethod, methodCallCreator.load(paramName));\n                } else {\n                    throw new RestClientDefinitionException(\n                            annotationName + \" method \" + declaringClass.toString() + \"#\" + staticMethodName\n                                    + \" has too many parameters, at most one parameter, param name, expected\");\n                }\n            } else {\n                // interface method\n                String mockName = mockInterface(declaringClass, generatedClasses, index);\n                ResultHandle interfaceMock = methodCallCreator.newInstance(MethodDescriptor.ofConstructor(mockName));\n\n                paramValueMethod = findMethod(declaringClass, declaringClass, methodName, clientParamAnnotation.toString());\n\n                if (paramValueMethod == null) {\n                    throw new RestClientDefinitionException(\n                            annotationName + \" method \" + methodName + \" not found on \" + declaringClass);\n                }\n\n                if (paramValueMethod.parametersCount() == 0) {\n                    paramValue = methodCallCreator.invokeInterfaceMethod(paramValueMethod, interfaceMock);\n                } else if (paramValueMethod.parametersCount() == 1 && isString(paramValueMethod.parameterType(0))) {\n                    paramValue = methodCallCreator.invokeInterfaceMethod(paramValueMethod, interfaceMock,\n                            methodCallCreator.load(paramName));\n                } else {\n                    throw new RestClientDefinitionException(\n                            annotationName + \" method \" + declaringClass + \"#\" + methodName\n                                    + \" has too many parameters, at most one parameter, param name, expected\");\n                }\n\n            }\n\n            Type returnType = paramValueMethod.returnType();\n            ResultHandle valuesList;","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/MicroProfileRestClientEnricher.java#L430-L466","documentation":"Thrown at build time when the valueFrom class referenced by @ClientQueryParam/@ClientHeaderParam is an interface (so the enricher generates a mock implementation), but the declared method name does not exist on that interface. The enricher cannot resolve the value-producing method so client generation fails.","triggerScenarios":"@ClientQueryParam(value=\"x\", valueFrom=MyInterface.class) where MyInterface has no method matching the required name lookup (findMethod with the annotation's toString), e.g. typo in method name or method removed after a refactor/version upgrade.","commonSituations":"Renaming interface methods after upgrading the library, referencing a value class whose API changed, or misspelling the method expected by the annotation processing.","solutions":["Ensure the interface declares a method with the exact expected name and compatible signature","Check the annotation value matches the method name in the interface","Rebuild the index/recompile so the Jandex index sees the method"],"exampleFix":"// before\ninterface Values { /* no getToken */ }\n@ClientQueryParam(value = \"token\", valueFrom = Values.class)\n// after\ninterface Values { String getToken(String name); }\n@ClientQueryParam(value = \"token\", valueFrom = Values.class)","handlingStrategy":"validation","validationCode":"// Verify the interface declares the expected method before using it in the annotation\nClass<?> c = Values.class;\nboolean ok = java.util.Arrays.stream(c.getDeclaredMethods())\n    .anyMatch(m -> m.getName().equals(\"getToken\") && m.getParameterCount() <= 1);\nif (!ok) throw new IllegalStateException(\"Values#getToken missing\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep valueFrom interfaces and annotations updated together","Grep for valueFrom references when renaming methods","Rebuild with the Jandex index refreshed after adding methods"],"tags":["rest-client","build-time","microprofile"],"backgroundTag":"rest-client-param-method-not-found","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}