From 9de3b943be83fd7d71cc98e821f3c5add474c366 Mon Sep 17 00:00:00 2001 From: Christoph Hermann Date: Thu, 12 Jan 2023 14:15:04 +0100 Subject: [PATCH] Add native compilation section I'd like to propose an additional section `Native compilation` describing how to use the `Validator` to avoid running into https://github.com/quarkusio/quarkus/issues/7686 --- docs/src/main/asciidoc/validation.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/src/main/asciidoc/validation.adoc b/docs/src/main/asciidoc/validation.adoc index cd1c752c54641..6c3a27e058a1f 100644 --- a/docs/src/main/asciidoc/validation.adoc +++ b/docs/src/main/asciidoc/validation.adoc @@ -474,6 +474,16 @@ In this case, it means `Book.id` must be `null` and `Book.title` must not be bla will be validated for the `book` parameter of the `put` method. In this case, it means `Book.id` must not be `null` and `Book.title` must not be blank. +== Native compilation + +Building a `Validator` using the `ValidatorFactory` is not possible in native mode. You will end in an +error similar to `javax.validation.NoProviderFoundException: Unable to create a Configuration, because no +Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your +classpath.` + +Always use an injected `Validator`. If you have to configure the `ValidatorFactory` follow the guide at +<>. + [[configuration-reference]] == Hibernate Validator Configuration Reference