Nondeterministic behavior of HibernateValidator (in springboot?) when both annotation and xml-based definition are used

MWE: GitHub - alfonz19/validator-fail-mwe

After fresh app start calling validation of annotated DTO will work as expected, and after that also validation of DTO having validation defined in validation-constraints.xml will work as expected. Everything works.

After fresh app start calling validation of DTO having validation defined in validation-constraints.xml will FAIL, and after that calling validation of annotated DTO will also FAIL. Now every validation FAILS.

Any idea? Any suggestion what to debug?

tested in springboot:

  • 2.7.12
  • 3.1.0

Hey @alfonz19
Thanks for reaching out and reporting the problem with a reproducer. I’ve replied to your JIRA ticket here - [HV-1949] - Hibernate JIRA

Thanks, I was just trying multiple fora as I didn’t get any traction with that on SO, so I was just hoping to get some hint anywhere. Sorry about this spamming. Thanks for confirming bug and workarounds, I will test them. I will update SO questions to link to this issue if anyone will find this.

hey no worries :smiley:
It would be nice if you could confirm that the programmatic definition helps – I have tried that on a small test and it worked, but you have a bigger app so let’s hope there’s nothing else in there.

Thanks, appreciate that!