quarkusio/quarkus · error · IllegalArgumentException
Raw MultivaluedMap parameter types are not supported. Offend
Error message
Raw MultivaluedMap parameter types are not supported. Offending method is: {jandexMethod} What it means
Same build-time check as the raw Map case, but specifically for `jakarta.ws.rs.core.MultivaluedMap`. The client processor must know the key/value types to generate code that populates headers or form params, and a raw MultivaluedMap provides no type information. Deployment aborts with this IllegalArgumentException.
Source
Thrown at extensions/resteasy-reactive/rest-client-jaxrs/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java:3405
}
isParamNull.trueBranch().assign(result, webTarget);
return result;
}
private Map.Entry<Type, Type> resolveMapTypes(Type type, MethodInfo jandexMethod) {
if (type.name().equals(ResteasyReactiveDotNames.MAP)) {
if (type.kind() != PARAMETERIZED_TYPE) {
throw new IllegalArgumentException(
"Raw Map parameter types are not supported. Offending method is: " + jandexMethod);
}
var parameterizedType = type.asParameterizedType();
var arguments = parameterizedType.arguments();
return new AbstractMap.SimpleEntry<>(arguments.get(0), arguments.get(1));
} else if (type.name().equals(ResteasyReactiveDotNames.MULTI_VALUED_MAP)) {
if (type.kind() != PARAMETERIZED_TYPE) {
throw new IllegalArgumentException(
"Raw MultivaluedMap parameter types are not supported. Offending method is: " + jandexMethod);
}
var parameterizedType = type.asParameterizedType();
var arguments = parameterizedType.arguments();
return new AbstractMap.SimpleEntry<>(arguments.get(0), ParameterizedType.create(ResteasyReactiveDotNames.LIST,
new Type[] { arguments.get(1) }, null));
}
// TODO: we could support this if necessary by looking up the resolved types via JandexUtil.resolveTypeParameters
throw new IllegalArgumentException("Unsupported Map type '" + type.name() + "'. Offending method is: " + jandexMethod);
}
private BranchResult iteratorHasNext(BytecodeCreator creator, ResultHandle iterator) {
return creator.ifTrue(
creator.invokeInterfaceMethod(ofMethod(Iterator.class, "hasNext", boolean.class), iterator));
}
private void addWebTargetParamToWebTarget(BytecodeCreator creator, ResultHandle paramName,
ResultHandle webTarget,View on GitHub (pinned to e1c734241f)
Solutions
- Declare `MultivaluedMap<String, String>` with explicit type arguments (the processor wraps the value type in List automatically)
- If you need multiple values per key as a plain body, use `Map<String, List<String>>` instead
- For arbitrary JSON bodies use `Map<String, Object>` or `String` with a custom serializer
Example fix
// before @POST void submit(MultivaluedMap form); // after @POST void submit(MultivaluedMap<String, String> form);
Defensive patterns
Strategy: validation
Validate before calling
if (param instanceof MultivaluedMap mv) { if (mv.getClass().getGenericSuperclass() instanceof ParameterizedType) { /* ok */ } else throw new IllegalArgumentException("MultivaluedMap must be parameterized"); } Type guard
static boolean isParameterizedMultivaluedMap(java.lang.reflect.Type t) { return t instanceof ParameterizedType pt && MultivaluedMap.class.isAssignableFrom((Class<?>) pt.getRawType()); } Prevention
- Prefer MultivaluedMap<String,String> for form/headers
- Run build with -Xlint:rawtypes
- Add code review checklist item for REST client interface generics
When it happens
Trigger: A REST client interface method with a raw `MultivaluedMap` parameter (e.g. `@FormParam` body `MultivaluedMap form`), processed at build time by JaxrsClientReactiveProcessor.
Common situations: Copying resource method signatures from tutorials that omit generics; refactoring `Map` to `MultivaluedMap` without adding type arguments; legacy JAX-RS code using raw types.
Related errors
- multipart responses can only be mapped to non-generic classe
- Type variable %s of %s could not be resolved.
- Raw Map parameter types are not supported. Offending method
- Unsupported Map type '{type.name()}'. Offending method is: {
- Unsupported wildcard type: ${wildcard}
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/2c899242d85a764c.
Report an issue: GitHub.