{"record":{"id":"81aea65243a53921","repo":"quarkusio/quarkus","slug":"unable-to-resolve-input-and-output-types-for-handl","errorCode":null,"errorMessage":"Unable to resolve input and output types for handler class <handlerClass.name()>","messagePattern":"Unable to resolve input and output types for handler class <handlerClass\\.name\\(\\)>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/RequestHandlerJandexUtil.java","lineNumber":42,"sourceCode":"    private RequestHandlerJandexUtil() {\n    }\n\n    public static RequestHandlerJandexDefinition discoverHandlerMethod(String handlerClassName, IndexView index) {\n        ClassInfo handlerClass = index.getClassByName(handlerClassName);\n        if (handlerClass == null) {\n            throw new IllegalArgumentException(\"RequestHandler class not found in the index: \" + handlerClassName);\n        }\n\n        MethodInfo concreteHandleRequestMethod = findConcreteHandleRequestMethod(handlerClass, index);\n        if (concreteHandleRequestMethod == null) {\n            throw new IllegalStateException(\n                    \"Unable to find a concrete handleRequest method on handler class \" + handlerClass.name());\n        }\n\n        Map<String, Type> typeMap = new HashMap<>();\n        InputOutputTypes inputOutputTypes = resolveInputOutputTypes(handlerClass.name(), index, typeMap);\n        if (isUnresolved(inputOutputTypes)) {\n            throw new IllegalStateException(\n                    \"Unable to resolve input and output types for handler class \" + handlerClass.name());\n        }\n\n        return new RequestHandlerJandexDefinition(handlerClass, concreteHandleRequestMethod, inputOutputTypes);\n    }\n\n    private static MethodInfo findConcreteHandleRequestMethod(ClassInfo handlerClass, IndexView index) {\n        ClassInfo currentClass = handlerClass;\n\n        // Look for implementations of the method in the class hierarchy\n        while (currentClass != null && !OBJECT.equals(currentClass.name())) {\n            for (MethodInfo method : currentClass.methods()) {\n                if (isHandleRequestMethod(method) && !method.isSynthetic() && !method.isAbstract()) {\n                    return method;\n                }\n            }\n\n            Type superType = currentClass.superClassType();","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/RequestHandlerJandexUtil.java#L24-L60","documentation":"A concrete handleRequest method was found, but resolving its generic input/output types (walking the type hierarchy to bind type variables) failed — the resolved InputOutputTypes still contains unresolved type variables, so the handler cannot be registered with correct request/response classes.","triggerScenarios":"discoverHandlerMethod calls resolveInputOutputTypes(handlerClass.name(), index, typeMap); isUnresolved(inputOutputTypes) returns true after walking the class hierarchy for generic parameter bindings.","commonSituations":"Deep generic hierarchies where intermediate classes live in unindexed jars; exotic generics (wildcards, raw types) on handleRequest; handler declared as e.g. implements RequestHandler<T, T> with type variables never bound.","solutions":["Declare concrete generic types on your handler: implements RequestHandler<MyIn, MyOut>, not raw or open type variables","Flatten the hierarchy — implement handleRequest directly on a concretely parameterized class","If types come from a dependency, ensure that jar is Jandex-indexed so the type resolution can walk it","Simplify wildcards/intersections (e.g. RequestHandler<List<?>, ?>) into named concrete types"],"exampleFix":"// before\nclass MyHandler implements RequestHandler<Map<String, ?>, List<?>> { ... }\n// after\nclass MyHandler implements RequestHandler<Map<String, String>, List<String>> { ... }","handlingStrategy":"validation","validationCode":"// bind generics concretely\ntypeCheck: class MyHandler implements RequestHandler<MyIn, MyOut> {} // never raw or type-variable parameters","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always parameterize RequestHandler with concrete types","Avoid wildcards and open type variables in handler generics","Index jars that contribute intermediate generic classes","Simplify deep generic hierarchies in Lambda handlers"],"tags":["quarkus","amazon-lambda","generics","jandex","build"],"backgroundTag":"unresolved-generic-types","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}