ValidationProviderResolver
5.2. ValidationProviderResolver In the case that the Java Service Provider mechanism does not work in your environment or you have a special classloader setup, you are able to provide a custom ValidationProviderResolver. An example in an OSGi environment you could plug your custom provider resolver like seen in Example 5.4, “Providing a custom ValidationProviderResolver”. Example 5.4. Providing a custom ValidationProviderResolver Configuration config = Validation.byDefaultProvider() .providerResolver( new OSGiServiceDiscoverer() ) .configure(); ValidatorFactory factory = config.buildValidatorFactory(); Validator validator = factory.getValidator(); Your OSGiServiceDiscoverer must in this case implement the interface ValidationProviderResolver: Example 5.5. ValidationProviderResolver interface public interface ValidationProviderResolver { /** * Returns a list of ValidationProviders available in the runtime environment. * * @return list of validation providers. */ List > getValidationProviders(); }