quarkusio/quarkus · error · IllegalStateException

A route requires validation, but the Hibernate Validator ext

Error message

A route requires validation, but the Hibernate Validator extension is not present

What it means

Raised in ReactiveRoutesProcessor.generateHandler when a route method's parameters carry validation constraints (Bean Validation annotations detected on route parameters) but the Hibernate Validator extension is not among the application's build dependencies. The generated handler bytecode would need to call the validator to enforce the constraints; without the extension present at build time there is nothing to call, so generation aborts with this message rather than silently skipping validation.

Source

Thrown at extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java:612

                        "Route method that returns void must accept at least one parameter that can end the response [method: %s, bean: %s]",
                        method, bean));
            }

            if (failureParams > 1) {
                throw new IllegalStateException(String.format(
                        "A failure handler may only define one failure parameter - route method %s declared on %s",
                        method, bean));
            }
        }
    }

    private String generateHandler(HandlerDescriptor desc, BeanInfo bean, MethodInfo method, Gizmo gizmo,
            TransformedAnnotationsBuildItem transformedAnnotations, AnnotationInstance routeAnnotation,
            BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy, String defaultProduces,
            boolean validatorAvailable, IndexView index) {

        if (desc.requireValidation() && !validatorAvailable) {
            throw new IllegalStateException(
                    "A route requires validation, but the Hibernate Validator extension is not present");
        }

        StringBuilder signature = new StringBuilder();
        signature.append(method.name()).append("_").append(method.returnType().name());
        for (Type parameterType : method.parameterTypes()) {
            signature.append(parameterType.name());
        }
        signature.append(routeAnnotation.toString(true));

        String generatedName = bean.getImplClazz().name().toString() + HANDLER_SUFFIX + "_" + method.name() + "_"
                + HashUtil.sha1(signature.toString());

        gizmo.class_(generatedName, cc -> {
            cc.extends_(RouteHandler.class);

            FieldDesc beanField = cc.field("bean", fc -> {
                fc.private_();

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add the quarkus-hibernate-validator extension to the application
  2. Remove the validation annotations from route parameters if validation is not intended
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java:612 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/8f375755ac4fb5cd. Report an issue: GitHub.