-
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 validation fails on a constructor parameter validation #28783
Comments
Grpc classes are my own, has nothing to do with it.. Should be reproducible with any bean.. |
Ah, okay |
Because of I'm guessing it's probably Arc doing some bytecode manipulation that ends up replacing/changing constructors? Since there is an I don't think we ever anticipated Hibernate Validator being used on such constructors. |
@ivansenic can you please prepare a small Maven reproducer? I'm pretty sure it has to do with ArC/interceptors/HV interactions. Not sure if we will be able to make it work but having a self contained reproducer would be a good first step. |
Will create one at some point this week.. |
@ivansenic friendly ping. |
Yea, forgot about this, will provide the reproducer by the end of the day. |
@gsmet Here it is: https://github.com/ivansenic/quarkus-28783 Hit
|
Hm, I'll take a look |
Thanks |
Actually, it seems we just don't pass around c-tor params correctly into invocation context for this scenario. |
Yeah I saw during debugging but was not sure why it was happening :) |
I think it is either an oversight or just a simple initial version of the code that wasn't discovered to be insufficient until now :) |
Understood, thanks :). I was kinda thrown off because we usually some kind of TODO (I've seen them in Arc as well over the years), so I was not sure what was going on. |
I've sent #29094 as an attempt to fix this. |
Wow this was fixed fast 🚀 |
I'm still having the same error, but with augmented arguments.(#29322 (comment)) |
@luca-bassoricci can you please create a new issue and attach a reproducer? |
issue-28783.zip
Removing |
Thanks, I'll take a look at it today or tomorrow. |
So the paramers I am seeing passed into that constructor are:
From a quick glance at the code, this happens because as soon as there is an around invoke interceptor, we need to create a subclass and this subclass has As a side note - this can be easily reproduced by using existing test and adding an around invoke interceptor to the |
I need to look at the generated code.
Ok, I got it - you mean just intecept a |
Describe the bug
I am getting a Hibernate exception like the one below when trying to add validation to the bean constructor method like this:
Removing the
@Pattern(regexp = "rest|graphql")
makes the injection to work fine.The stack trace from the cause:
Not sure if there are some config props to handle this behavior? I am sure why would the hibernate go for the no-args constructor here?
Expected behavior
Injection and validation works.
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.13.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: /home/ise/.m2/wrapper/dists/apache-maven-3.8.4-bin/52ccbt68d252mdldqsfsn03jlf/apache-maven-3.8.4 Java version: 17.0.4, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "5.15.0-52-generic", arch: "amd64", family: "unix"
Additional information
No response
The text was updated successfully, but these errors were encountered: