{"record":{"id":"9c6d615f31c8442a","repo":"quarkusio/quarkus","slug":"parameter-type-type-is-not-supported-for-metho","errorCode":null,"errorMessage":"Parameter type '<type>' is not supported for method '<method>' of class '<class>'","messagePattern":"Parameter type '<type>' is not supported for method '<method>' of class '<class>'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-web/core/deployment/src/main/java/io/quarkus/spring/web/deployment/ControllerAdviceExceptionMapperGenerator.java","lineNumber":285,"sourceCode":"                if (typesUtil.isAssignable(Exception.class, parameterType.name())) {\n                    parameterTypeHandles[i] = bc.localVar(\"param\" + i, exceptionParam);\n                } else if (typesUtil.isAssignable(UriInfo.class, parameterType.name())) {\n                    parameterTypeHandles[i] = bc.localVar(\"param\" + i, getBeanFromArc(bc, UriInfo.class.getName()));\n                } else if (typesUtil.isAssignable(Request.class, parameterType.name())) {\n                    parameterTypeHandles[i] = bc.localVar(\"param\" + i, getBeanFromArc(bc, Request.class.getName()));\n                } else if (typesUtil.isAssignable(HttpServerRequest.class, parameterType.name())) {\n                    parameterTypeHandles[i] = bc.localVar(\"param\" + i,\n                            getBeanFromArc(bc, HttpServerRequest.class.getName()));\n                } else if (typesUtil.isAssignable(HttpServerResponse.class, parameterType.name())) {\n                    LocalVar requestHandle = bc.localVar(\"request\",\n                            getBeanFromArc(bc, HttpServerRequest.class.getName()));\n                    parameterTypeHandles[i] = bc.localVar(\"param\" + i, bc.invokeInterface(\n                            MethodDesc.of(HttpServerRequest.class,\n                                    \"response\",\n                                    HttpServerResponse.class),\n                            requestHandle));\n                } else {\n                    throw new IllegalArgumentException(\n                            \"Parameter type '\" + parameterType.name() + \"' is not supported for method '\"\n                                    + controllerAdviceMethod.name() + \"' of class '\"\n                                    + controllerAdviceMethod.declaringClass().name()\n                                    + \"'\");\n                }\n            }\n        }\n\n        return bc.invokeVirtual(\n                ClassMethodDesc.of(declaringClassDesc, controllerAdviceMethod.name(), returnTypeClassDesc,\n                        parameterTypeClassDescs),\n                controllerAdviceInstance(bc), parameterTypeHandles);\n    }\n\n    private LocalVar controllerAdviceInstance(BlockCreator bc) {\n        ClassDesc declaringClassDesc = ClassDesc.of(declaringClassName);\n        if (isResteasyClassic) {\n            LocalVar controllerAdviceClass = bc.localVar(\"controllerAdviceClass\",","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-web/core/deployment/src/main/java/io/quarkus/spring/web/deployment/ControllerAdviceExceptionMapperGenerator.java#L267-L303","documentation":"In the bytecode-generation phase (invokeExceptionHandlerMethod), a parameter that is not an Exception subtype, HttpServletRequest, or HttpServletResponse cannot be bound to a generated value, so IllegalArgumentException is thrown naming the type, method, and class. This is the runtime-body counterpart of the pre-generation signature validation and aborts the build.","triggerScenarios":"A @ControllerAdvice @ExceptionHandler method whose parameters include a type outside the supported set slipping past pre-generation checks (e.g. unusual orderings or types the pre-check path did not flag) and failing while emitting invoke bytecode.","commonSituations":"Migrating complex Spring exception handlers; parameter types like Model, Locale, HttpHeaders, or custom context objects; framework version changes altering which signatures are validated earlier.","solutions":["Restrict handler parameters to Exception subtypes, HttpServletRequest, and HttpServletResponse","Remove or refactor unsupported parameters from the @ControllerAdvice method","Rebuild after the fix; this is a build-time failure so no runtime workaround exists","If the type is essential, write a standard JAX-RS ExceptionMapper instead of relying on Spring @ControllerAdvice mapping"],"exampleFix":"// before\n@ExceptionHandler(Exception.class)\nvoid handle(Exception e, Locale locale) {...}\n// after\n@ExceptionHandler(Exception.class)\nvoid handle(Exception e, HttpServletRequest req) { Locale locale = req.getLocale(); ... }","handlingStrategy":"validation","validationCode":"if (!Exception.class.isAssignableFrom(paramType) && !HttpServletRequest.class.isAssignableFrom(paramType)\n    && !HttpServletResponse.class.isAssignableFrom(paramType)) {\n  throw new IllegalStateException(\"Handler param \" + paramType + \" unsupported by ControllerAdvice mapper\");\n}","typeGuard":"boolean isSupportedHandlerParam(Class<?> t) {\n  return Exception.class.isAssignableFrom(t)\n      || HttpServletRequest.class.isAssignableFrom(t)\n      || HttpServletResponse.class.isAssignableFrom(t);\n}","tryCatchPattern":null,"preventionTips":["Validate handler signatures against supported types before building","Prefer JAX-RS ExceptionMapper for parameters beyond the supported set","Rebuild early in migration to surface generation errors immediately"],"tags":["quarkus","spring-web","controlleradvice","build-time","unsupported-parameter","bytecode-generation"],"backgroundTag":"unsupported-method-signature","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"}