|
When using validation mode AUTO and a Bean Validation provider is present in the environment but fails to be bootstrapped, that error is silently ignored, resulting in no validation taking place.
Instead an exception should be raised, informing about the issue with the BV provider.
One problem is that right now it's not possible in a portable manner to distinguish between the case where no provider is present at all (which is acceptable for mode AUTO) and the case where a provider is present but failed to be bootstrapped (which is not acceptable). We would cover the majority of cases though by specifically looking for the error message raised by the official BV spec JAR in the first case:
Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
|