quarkusio/quarkus · error · IllegalArgumentException
Illegal type in hierarchy: ${type}
Error message
Illegal type in hierarchy: ${type} What it means
IllegalArgumentException from JandexUtil.mapGenerics default branch: the type being mapped has a Jandex kind not handled by the switch (not array, class, parameterized, or type variable) — e.g. a wildcard or unresolved type appearing where a concrete mapped type is required. The offending type is interpolated into the message.
Source
Thrown at independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/JandexUtil.java:306
return ArrayType.create(mapGenerics(arrayType.constituent(), mapping), arrayType.dimensions());
case CLASS:
return type;
case PARAMETERIZED_TYPE:
ParameterizedType parameterizedType = type.asParameterizedType();
Type owner = null;
if (parameterizedType.owner() != null) {
owner = mapGenerics(parameterizedType.owner(), mapping);
}
return ParameterizedType.create(parameterizedType.name(),
mapGenerics(parameterizedType.arguments(), mapping).toArray(new Type[0]), owner);
case TYPE_VARIABLE:
Type ret = mapping.get(type.asTypeVariable().identifier());
if (ret == null) {
throw new IllegalArgumentException("Missing type argument mapping for " + type);
}
return ret;
default:
throw new IllegalArgumentException("Illegal type in hierarchy: " + type);
}
}
private static ClassInfo fetchFromIndex(DotName dotName, IndexView index) {
final ClassInfo classInfo = index.getClassByName(dotName);
if (classInfo == null) {
throw new IllegalArgumentException("Class " + dotName + " was not found in the index");
}
return classInfo;
}
/**
* Returns the enclosing class of the given annotation instance. For field, method or record component annotations,
* this will return the enclosing class. For parameters, this will return the enclosing class of the enclosing
* method. For classes, it will return the class itself. For type annotations, it will return the class enclosing
* the annotated type usage.
*
* @param annotationInstance the annotation whose enclosing class to look upView on GitHub (pinned to e1c734241f)
Solutions
- Replace the wildcard/unusual generic construct with a concrete type in the resource signature
- Report as a RESTEasy Reactive issue if the type usage looks valid
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/JandexUtil.java:306 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/f46575a9dd6a0e60.
Report an issue: GitHub.