quarkusio/quarkus · error · IllegalArgumentException
No getter corresponding to " + methodInfo.declaringClass().n
Error message
No getter corresponding to " + methodInfo.declaringClass().name() + "#" + methodInfo.name() + " found
What it means
BeanParamParser.getGetterMethod throws this when building a REST Client @BeanParam: it cannot find a getter method on the parameter class that matches the annotated field. RESTEasy Reactive's client processor needs a getter/setter pair to populate bean param properties at request build time; a field with @QueryParam/@PathParam etc. but no matching getXxx()/isXxx() method cannot be wired.
Source
Thrown at independent-projects/resteasy-reactive/client/processor/src/main/java/org/jboss/resteasy/reactive/client/processor/beanparam/BeanParamParser.java:271
if (annotation == null || annotation.value() == null)
return null;
return annotation.value().asString();
}
private static MethodInfo getGetterMethod(ClassInfo beanParamClass, MethodInfo methodInfo) {
MethodInfo getter = null;
if (methodInfo.parametersCount() > 0) { // should be setter
// find the corresponding getter:
String setterName = methodInfo.name();
if (setterName.startsWith("set")) {
getter = beanParamClass.method(setterName.replace("^set", "^get"));
}
} else if (methodInfo.name().startsWith("get")) {
getter = methodInfo;
}
if (getter == null) {
throw new IllegalArgumentException(
"No getter corresponding to " + methodInfo.declaringClass().name() + "#" + methodInfo.name() + " found");
}
return getter;
}
private static <T extends Item> List<T> paramItemsForFieldsAndMethods(ClassInfo beanParamClass, DotName parameterType,
BiFunction<String, FieldInfo, T> fieldExtractor, BiFunction<String, MethodInfo, T> methodExtractor) {
return ParamTypeAnnotations.of(beanParamClass, parameterType).itemsForFieldsAndMethods(fieldExtractor, methodExtractor);
}
private BeanParamParser() {
}
private static class ParamTypeAnnotations {
private final ClassInfo beanParamClass;
private final List<AnnotationInstance> annotations;
private ParamTypeAnnotations(ClassInfo beanParamClass, DotName parameterType) {View on GitHub (pinned to e1c734241f)
Solutions
- Add a standard getter for each annotated field (getName() or isName() for booleans).
- Rename the field/method so the getter follows the get/is prefix convention matching the field name.
- If using fluent accessors, add conventional getters alongside them, or use public setter+getter pairs.
- Verify the class is not a Java record; records are not supported as BeanParam with this parser — convert to a plain class with getters/setters.
Example fix
// before
class MyParams {
@QueryParam("q")
String query;
String query() { return query; } // fluent, not a getter
}
// after
class MyParams {
@QueryParam("q")
String query;
public String getQuery() { return query; }
public void setQuery(String q) { this.query = q; }
} Defensive patterns
Strategy: validation
Validate before calling
// Build-time check: every annotated field in a @BeanParam class must have a getter
for (Field f : beanParamClass.getDeclaredFields()) {
if (f.isAnnotationPresent(QueryParam.class) || f.isAnnotationPresent(HeaderParam.class)) {
String g = "get" + Character.toUpperCase(f.getName().charAt(0)) + f.getName().substring(1);
boolean hasGetter = false;
for (Method m : beanParamClass.getMethods()) {
if (m.getName().equals(g) || (m.getName().equals("is" + g.substring(3)) && (m.getReturnType() == boolean.class))) { hasGetter = true; break; }
}
if (!hasGetter) throw new IllegalStateException(f.getName() + " has no getter");
}
} Prevention
- Always pair @BeanParam fields with standard get/is prefixed getters
- Do not use Java records or fluent accessors for @BeanParam classes
- Add an ArchUnit/unit test validating BeanParam classes have getters
When it happens
Trigger: Using a @BeanParam class in a REST Client interface where a field carries a REST parameter annotation (@QueryParam, @HeaderParam, @PathParam, @CookieParam) but has no corresponding getter (getXxx, isXxx for booleans) or the method name doesn't start with get/is.
Common situations: Refactoring a DTO and renaming a getter without renaming the field; using record-style or fluent (chained, non-get-prefixed) accessors; Kotlin `val` properties compiled without standard bean getters in some setups; copying server-side resource classes (where fields suffice) into client code.
Related errors
- Invalid Flyway callback. It shouldn't be abstract and must h
- 'quarkus-narayana-lra' can only work if 'quarkus-rest-client
- io.quarkus.oidc.client.OidcClientFilter annotation can be ap
- Unable to instantiate SectionHelperFactory: <engineConfigCla
- Unable to instantiate ParserHook: <engineConfigClass>
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/5ef2e8aad168a633.
Report an issue: GitHub.