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
Catch defensively exception thrown by validation contraints AOT processing of Kotlin extensions #30037
Comments
Thanks for the report. It is difficult to tell what's going on with limited information. If you would like us to spend some time investigating, please provide a complete minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it and attaching it to this issue. |
You will find a minimal sample here. You will reproduce the problem by running Things I've noticed during my investigation :
Cheers! |
It looks like the fix #29823 has now triggered another bug which I think could be https://hibernate.atlassian.net/browse/HV-1796. I can replicate the same issue by adding the following test to your sample project: class ValidationTests {
@Test
fun validate() {
val validator: Validator = Validation.buildDefaultValidatorFactory().validator
val clazz: Class<*> = DemoService::class.java
validator.getConstraintsForClass(clazz)
}
} I don't think there is anything that we can do in Spring Boot to fix this, but perhaps Spring Framework can be more defensive when invoking @bclozel Could you please transfer this issue? /cc @sdeleuze |
An ArrayIndexOutOfBoundsException is thrown by Validator.getConstraintsForClass when processing Kotlin beans with extensions functions (Kotlin or Hibernate Validator bug). This commit catches those exceptions and report them as warning without the full stactrace, and report as well other ones thrown as errors with the full stracktrace. Closes spring-projectsgh-30037
An ArrayIndexOutOfBoundsException is thrown by Validator.getConstraintsForClass when processing Kotlin beans with extensions functions (Kotlin or Hibernate Validator bug). This commit catches those exceptions and report them as warning without the full stactrace, and report as well other ones thrown as errors with the full stracktrace. Closes spring-projectsgh-30037
spring-boot-maven-plugin:process-aot
not working with latest 3.0.3An ArrayIndexOutOfBoundsException is thrown by Validator.getConstraintsForClass when processing Kotlin beans with extensions functions (Kotlin or Hibernate Validator bug). This commit catches those exceptions and report them as warning without the full stactrace, and report as well other ones thrown as errors with the full stracktrace. Closes spring-projectsgh-30037
Maven goal
spring-boot-maven-plugin:process-aot
does not work anymore on our side. It worked with v3.0.2. With latest v3.0.3 we have the following error :We get the error by running
mvn native:compile -Pnative
.The text was updated successfully, but these errors were encountered: