{"record":{"id":"3da29396c5c0ebcc","repo":"quarkusio/quarkus","slug":"handlertype-s-is-not-legal-for-parameter-s-of-ro","errorCode":null,"errorMessage":"HandlerType.%s is not legal for parameter %s of route method %s declared on %s","messagePattern":"HandlerType\\.(.+?) is not legal for parameter (.+?) of route method (.+?) declared on (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java","lineNumber":574,"sourceCode":"            int idx = 0;\n            int failureParams = 0;\n            for (Type paramType : params) {\n                Set<AnnotationInstance> paramAnnotations = Annotations.getParameterAnnotations(transformedAnnotations,\n                        method, idx);\n                List<ParameterInjector> injectors = getMatchingInjectors(paramType, paramAnnotations, index);\n                if (injectors.isEmpty()) {\n                    throw new IllegalStateException(String.format(\n                            \"No parameter injector found for parameter %s of route method %s declared on %s\", idx,\n                            method, bean));\n                }\n                if (injectors.size() > 1) {\n                    throw new IllegalStateException(String.format(\n                            \"Multiple parameter injectors found for parameter %s of route method %s declared on %s\",\n                            idx, method, bean));\n                }\n                ParameterInjector injector = injectors.get(0);\n                if (injector.getTargetHandlerType() != null && !injector.getTargetHandlerType().equals(handlerType)) {\n                    throw new IllegalStateException(String.format(\n                            \"HandlerType.%s is not legal for parameter %s of route method %s declared on %s\",\n                            injector.getTargetHandlerType(), idx, method, bean));\n                }\n\n                // A param injector may validate the parameter annotations\n                injector.validate(bean, method, routeAnnotation, paramType, paramAnnotations);\n\n                if (injector.canEndResponse) {\n                    canEndResponse = true;\n                }\n\n                if (Route.HandlerType.FAILURE == handlerType && isThrowable(paramType, index)) {\n                    failureParams++;\n                }\n                idx++;\n            }\n\n            if (method.returnType().kind() == Kind.VOID && !canEndResponse) {","sourceCodeStart":556,"sourceCodeEnd":592,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java#L556-L592","documentation":"Raised by ReactiveRoutesProcessor.validateRouteMethod when the ParameterInjector selected for a parameter declares a target handler type that does not match the method's configured Route.HandlerType (e.g. a failure-only injector used in a NORMAL route). The injector advertises which handler types it is legal for; the validation compares that with the handlerType derived from the @Route annotation and fails fast at build time with the offending injector, parameter index, method and bean.","triggerScenarios":"Thrown at extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java:574 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Align the @Route handlerType with the parameter (e.g. use a failure parameter only on a FAILURE route)","Remove the parameter type that requires a different handler type from this method","If using a custom ParameterInjector, fix its target handler type declaration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}