"Provider org.hibernate.validator.HibernateValidator not a subtype" error during service discovery

Description

While using DefaultProviderResolver, we get the following error when there are multiple validator implementations in classpath and one ahead in the classpath is not class loader compatible with the api jar:

I have tracked the error down to beanvalidation-api/src/main/java/javax/validation/Validation.java where it is not handling ServiceConfigurationError correctly. This code was introduced in BVAL-298. There was a discussion about ServiceConfigurationError in as well. The correct thing to do is to ignore the ServiceConfigurationError and try the next available provider. I am attaching a patch to this effect.

Environment

None

Assignee

Hardy Ferentschik

Reporter

Sanjeeb Sahoo

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Critical
Configure