{"record":{"id":"f4934e434f11e5a5","repo":"quarkusio/quarkus","slug":"annotationname-method-declaringclass-stati","errorCode":null,"errorMessage":"${annotationName} method ${declaringClass}#${staticMethodName} has too many parameters, at most one parameter, param name, expected","messagePattern":"(.+?) method (.+?)#(.+?) has too many parameters, at most one parameter, param name, expected","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":436,"sourceCode":"            if (methodName.contains(\".\")) {\n                // calling a static method\n                int endOfClassName = methodName.lastIndexOf('.');\n                String className = methodName.substring(0, endOfClassName);\n                String staticMethodName = methodName.substring(endOfClassName + 1);\n\n                ClassInfo clazz = index.getClassByName(DotName.createSimple(className));\n                if (clazz == null) {\n                    throw new RestClientDefinitionException(\n                            \"Class \" + className + \" used in \" + annotationName + \" on \" + declaringClass + \" not found\");\n                }\n                paramValueMethod = findMethod(clazz, declaringClass, staticMethodName, clientParamAnnotation.toString());\n\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))) {","sourceCodeStart":418,"sourceCodeEnd":454,"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#L418-L454","documentation":"Quarkus REST Client build-time validation error thrown when a @ClientQueryParam/@ClientHeaderParam value method on a class is declared with more than one parameter. Only a zero-arg method or a single String parameter (receiving the header/param name) is allowed, because the generated code calls the method statically with at most the param name.","triggerScenarios":"Annotating an interface with @ClientQueryParam(value=\"x\", valueFrom=SomeStatic.class) where the referenced static method has 2+ parameters, or one non-String parameter, causing the bytecode generator to fail at build time.","commonSituations":"Developers write helper methods expecting request context or config objects, or add a second parameter for convenience, then the Quarkus build fails with RestClientDefinitionException.","solutions":["Change the value method to have zero parameters","If the method needs the param/header name, keep exactly one String parameter","Move additional dependencies into static fields or constructor-less helpers"],"exampleFix":"// before\nclass Headers { static String token(String name, String scope) { ... } }\n@ClientQueryParam(value = \"token\", valueFrom = Headers.class)\n// after\nclass Headers { static String token(String name) { ... } }\n@ClientQueryParam(value = \"token\", valueFrom = Headers.class)","handlingStrategy":"validation","validationCode":"// Build-time check: ensure each valueFrom static method has 0 params or 1 String param\nfor (Method m : Values.class.getDeclaredMethods()) {\n    if (m.getParameterCount() > 1 || (m.getParameterCount() == 1 && m.getParameterTypes()[0] != String.class))\n        throw new IllegalStateException(m + \" must take at most one String param\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep value provider methods zero-arg or single String","Add an ArchUnit/unit test asserting valueFrom method signatures","Never add parameters to value-provider methods without checking usages"],"tags":["rest-client","build-time","microprofile"],"backgroundTag":"rest-client-param-method-signature-invalid","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"}