-
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 - @Valid Object causes CNFE #12443
Labels
Milestone
Comments
/cc @gsmet |
So we can add a safeguard for this, for sure. But keep in mind that having |
Yeah, quarkus needs a list of all types. but a safeguard might help in case someone else has this problem. |
gsmet
added a commit
to gsmet/quarkus
that referenced
this issue
Oct 9, 2020
@Postremus could you check #12627 ? |
gsmet
added a commit
to gsmet/quarkus
that referenced
this issue
Oct 10, 2020
gsmet
added a commit
to gsmet/quarkus
that referenced
this issue
Nov 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I noticed an odd behaviour in one of my apps during dev mode.
mvn clean install runs sucessfully on the project.
@Valid Object
causes a CNFE for javax.servlet.Filter. The project did not use servlets however.After a bit of debugging, I found this place in the Hibernate Validator extension:
quarkus/extensions/hibernate-validator/deployment/src/main/java/io/quarkus/hibernate/validator/deployment/HibernateValidatorProcessor.java
Lines 308 to 317 in 8f24c19
It was adding the JaxRsMetricsFilter to the set of classes that need validation. In turn, this loaded at runtime the servlet Filter class.
Removing the
@Valid Object
constraint solved the problem for me.Expected behavior
Quarkus should not blindly add every class it finds as possible class that needs validation. E.g. most of the quarkus internal classes may never need to be validated in user applications.
Actual behavior
To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
Or attach an archive containing the reproducer to the issue.
metrics-cnfe-filter.zip
Steps to reproduce the behavior:
Environment (please complete the following information):
uname -a
orver
: MSYS_NT-10.0 NANB7NLNVP2 2.10.0(0.325/5/3) 2018-06-13 23:34 x86_64 Msysmvnw --version
orgradlew --version
):Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Users\mnp.m2\wrapper\dists\apache-maven-3.6.3-bin\1iopthnavndlasol9gbrbg6bf2\apache-maven-3.6.3
Java version: 11.0.7, vendor: Azul Systems, Inc., runtime: C:\eclipse\tools\zulu11.39.15-ca-jdk11.0.7-win_x64
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
The text was updated successfully, but these errors were encountered: