quarkusio/quarkus · error · RuntimeException
Unknown parameter type
Error message
Unknown parameter type
What it means
EndpointIndexer.toClassName encountered a Type.Kind it cannot translate to a Java class name when resolving a resource method parameter/return type. The switch's default branch throws RuntimeException('Unknown parameter type ' + indexType) for kinds not explicitly handled (e.g. parameterized types in unexpected positions, intersection types).
Source
Thrown at independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java:1162
case WILDCARD_TYPE:
WildcardType wildcardType = indexType.asWildcardType();
Type extendsBound = wildcardType.extendsBound();
if (extendsBound.name().equals(OBJECT)) {
// this is a super bound type that we don't support
throw new RuntimeException("Cannot handle wildcard type " + indexType);
}
// this is an extend bound type, so we just user the bound
return wildcardType.name().toString();
case TYPE_VARIABLE:
TypeVariable typeVariable = indexType.asTypeVariable();
if (typeVariable.bounds().isEmpty()) {
return Object.class.getName();
}
return toClassName(resolveTypeVariable(typeVariable, currentClass, actualEndpointClass, indexView),
currentClass, actualEndpointClass, indexView);
default:
throw new RuntimeException("Unknown parameter type " + indexType);
}
}
private static Type resolveTypeVariable(TypeVariable typeVariable, ClassInfo currentClass, ClassInfo actualEndpointClass,
IndexView indexView) {
if (typeVariable.bounds().isEmpty()) {
return Type.create(DotName.createSimple(Object.class.getName()), Kind.CLASS);
}
int pos = -1;
List<TypeVariable> typeVariables = currentClass.typeParameters();
for (int i = 0; i < typeVariables.size(); ++i) {
if (typeVariables.get(i).identifier().equals(typeVariable.identifier())) {
pos = i;
break;
}
}
if (pos != -1) {
Type resolved = resolveTypeParameters(pos, actualEndpointClass, currentClass, indexView);View on GitHub (pinned to e1c734241f)
Solutions
- Simplify the endpoint method signature to concrete, non-generic or simple-generic types
- Move complex generic types out of the REST layer into internal service code
- Check the Quarkus/RESTEasy Reactive version; upgrade, since type-kind support grows over time; file an issue with a reproducer if it persists
Example fix
// before
@POST
public void create(Map<String, Map<String, List<Set<?>>>> payload) { ... }
// after
@POST
public void create(MyDto payload) { ... } Defensive patterns
Strategy: validation
Validate before calling
// Keep endpoint signatures to supported kinds: Class, simple ParameterizedType, arrays
static void validateEndpoint(Method m) {
java.util.ArrayDeque<java.lang.reflect.Type> q = new java.util.ArrayDeque<>();
q.add(m.getGenericReturnType());
for (java.lang.reflect.Type p : m.getGenericParameterTypes()) q.add(p);
while (!q.isEmpty()) {
java.lang.reflect.Type t = q.poll();
if (t instanceof ParameterizedType pt) {
for (java.lang.reflect.Type a : pt.getActualTypeArguments()) {
if (!(a instanceof Class) && !(a instanceof ParameterizedType))
throw new IllegalStateException("Unsupported type in " + m + ": " + a);
q.add(a);
}
}
}
} Prevention
- Use plain DTOs for complex data instead of deeply nested generic collections
- Avoid intersection types and exotic generics in resource method signatures
- Upgrade Quarkus regularly — supported type kinds expand over time
- Keep a smoke build (mvn quarkus:dev) that indexes all endpoints before CI
When it happens
Trigger: Deploying an endpoint whose method signature contains a Jandex Type kind the processor does not support — typically exotic generics, intersection bounds, or nested parameterized types in the endpoint declaration.
Common situations: Very complex generic declarations (nested generics of generics) in resource methods; generated or bytecode-enhanced types with unusual type structures; framework versions encountering a new type shape from newer Java features.
Related errors
- Cannot handle wildcard type
- Failed to find Collection supertype of ${field}
- Unsupported type: " + type
- Parameter: ${i} of the constructor of class '${resourceDotNa
- Unable to load handled exception type ${i.getProvidedType()}
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/1d992255515a4ab9.
Report an issue: GitHub.