{"record":{"id":"eb66c788ebacf2c6","repo":"quarkusio/quarkus","slug":"missing-type-argument-mapping-for","errorCode":null,"errorMessage":"Missing type argument mapping for ","messagePattern":"Missing type argument mapping for ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/util/JandexUtil.java","lineNumber":276,"sourceCode":"    private static Type mapGenerics(Type type, Map<String, Type> mapping) {\n        switch (type.kind()) {\n            case ARRAY:\n                ArrayType arrayType = type.asArrayType();\n                return ArrayType.create(mapGenerics(arrayType.constituent(), mapping), arrayType.dimensions());\n            case CLASS:\n                return type;\n            case PARAMETERIZED_TYPE:\n                ParameterizedType parameterizedType = type.asParameterizedType();\n                Type owner = null;\n                if (parameterizedType.owner() != null) {\n                    owner = mapGenerics(parameterizedType.owner(), mapping);\n                }\n                return ParameterizedType.create(parameterizedType.name(),\n                        mapGenerics(parameterizedType.arguments(), mapping).toArray(new Type[0]), owner);\n            case TYPE_VARIABLE:\n                Type ret = mapping.get(type.asTypeVariable().identifier());\n                if (ret == null) {\n                    throw new IllegalArgumentException(\"Missing type argument mapping for \" + type);\n                }\n                return ret;\n            default:\n                throw new IllegalArgumentException(\"Illegal type in hierarchy: \" + type);\n        }\n    }\n\n    private static ClassInfo fetchFromIndex(DotName dotName, IndexView index) {\n        final ClassInfo classInfo = index.getClassByName(dotName);\n        if (classInfo == null) {\n            throw new ClassNotIndexedException(dotName);\n        }\n        return classInfo;\n    }\n\n    /**\n     * Returns the enclosing class of the given annotation instance. For field, method or record component annotations,\n     * this will return the enclosing class. For parameters, this will return the enclosing class of the enclosing","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/util/JandexUtil.java#L258-L294","documentation":"JandexUtil.mapGenerics resolves a TYPE_VARIABLE in a type hierarchy against a mapping of type-variable identifiers to concrete Types built while walking the class/interface hierarchy. If the identifier is absent from the mapping, the type arguments of the hierarchy could not be resolved and Quarkus throws this IllegalArgumentException. It signals an internal inconsistency: the type being expanded references a type variable that no enclosing parameterized supertype provided an argument for.","triggerScenarios":"Calling a JandexUtil helper that resolves a generic supertype or interface (e.g. resolving getBindingTypes/determineType hierarchy) where a super interface/class is parameterized in a way the walk did not capture, or where a raw/erased supertype loses the argument needed to satisfy a declared type variable.","commonSituations":"A CDI bean or resource class extends a generic base class without providing the type argument (raw type usage), unusual self-referential generics (e.g. class A<T> extends B<A<T>>), or Quarkus version changes in generic-hierarchy resolution logic being hit by an extension that passes a type containing free type variables.","solutions":["Make the class provide concrete type arguments for every type variable in its hierarchy (e.g. class MyRepo implements Repository<MyEntity, Long> instead of raw Repository).","Check for raw types in the hierarchy: an erased supertype drops the argument needed to bind the type variable; parameterize it.","If writing an extension, ensure the mapping passed to JandexUtil.mapGenerics covers all type-variable identifiers of the declaring type.","Reproduce with a minimal class hierarchy and file a Quarkus issue if a concrete hierarchy still fails — this indicates a resolver bug."],"exampleFix":"// before\nclass MyRepo implements Repository {\n}\n// after\nclass MyRepo implements Repository<MyEntity, Long> {\n}","handlingStrategy":"validation","validationCode":"static boolean hasBoundTypeVars(org.jboss.jandex.Type t, java.util.Set<String> bound) {\n    if (t.kind() == org.jboss.jandex.Type.Kind.TYPE_VARIABLE)\n        return bound.contains(t.asTypeVariable().identifier());\n    return true;\n}","typeGuard":"if (type.kind() != Type.Kind.TYPE_VARIABLE || mapping.containsKey(type.asTypeVariable().identifier())) { /* safe to resolve */ }","tryCatchPattern":"try { resolveHierarchy(clazz); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Missing type argument mapping\")) { /* raw generic hierarchy: parameterize or handle */ } else throw e; }","preventionTips":["Always parameterize generic superclasses/interfaces with concrete types","Avoid raw types in class hierarchies","When writing extensions, verify the mapping covers all type-variable identifiers before calling mapGenerics"],"tags":["jandex","generics","deployment-time"],"backgroundTag":"unresolved-type-variable","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"}