-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hibernate-Validator: Custom ValueExtractor
is not automatically registered
#20347
Comments
I sort of remember something similar being reported in the past, but I'll let the HV experts weigh in on this one. One thing I would ask however is to give |
Doesnt't work in |
Thanks for checking |
It should work given https://github.com/quarkusio/quarkus/blob/main/extensions/hibernate-validator/runtime/src/main/java/io/quarkus/hibernate/validator/runtime/HibernateValidatorRecorder.java#L133-L137 . By any chance, is your If not, can you create a small reproducer? |
In our application the
You can find a reproducer in the issue description under |
Hmm, how do you get your module indexed? Do you have an empty |
In the reproducer above there isn't an external module. So it should work out of the box. In our real application the Jandex index is created via the Do we have to create an empty file |
Not really a reproducer if it doesn't reproduce the problem ;)
According to the Quarkus CDI documentation, having a Jandex index in your dependency at But adding Or provide a reproducer, then we can try things ourselves :) |
Ok, i checked it. I followed exactly my description to reproduce the problem and i can reproduce the issue without problems. Even a simple [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.075 s <<< FAILURE! - in org.acme.ReactiveGreetingResourceTest
[ERROR] org.acme.ReactiveGreetingResourceTest.testHelloEndpoint Time elapsed: 0.008 s <<< ERROR!
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
Caused by: java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: javax.validation.ConstraintDeclarationException: HV000197: No value extractor found for type parameter 'T' of type org.acme.Container.
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ReactiveGreetingResourceTest.testHelloEndpoint » Runtime java.lang.ExceptionIn...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
I tried out your suggestion. Adding a
See above. |
Seems like I misunderstood what you were saying about "working out of the box". Sorry about that. Thanks for the reproducer, I will have a look. |
No problem, thank you 👍 |
@yrodiere I've created a simple reproducer (see attached). |
Thank you. Yes I'm working on it. The bad news is, even after I solve this problem, there are others that still prevent us from using value extractors... I'm on it. |
Describe the bug
A custom
ValueExtractor
is not automatically registered by quarkus (https://quarkus.io/guides/validation#hibernate-validator-extension-and-cdi).Note: Registration via Service-Loader-API works as expected (https://docs.jboss.org/hibernate/validator/6.2/reference/en-US/html_single/#section-valueextraction-registeringvalueextractor).
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
./mvnw quarkus:dev
Output of
uname -a
orver
No response
Output of
java -version
Java 11
GraalVM version (if different from Java)
No response
Quarkus version or git rev
Quarkus 2.2.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.1
Additional information
No response
The text was updated successfully, but these errors were encountered: