Issue Type: Bug Bug
Affects Versions: 4.3.0.Final
Assignee: Unassigned
Components: engine
Created: 14/Jun/12 3:01 PM
Description:

I'm using the Validation class in a Thread that has the context class loader set to a class loader that will not find the JAR file containing the Validation class. When calling

Validation.buildDefaultValidatorFactory();

in this environment, it results in a ValidationException being throw from GenericBootstrapImpl.configure with the message "Unable to find a default provider".

The reason for this is that DefaultValidationProviderResolver.getValidationProviders uses the thread context class loader to get the "META-INF/services/javax.validation.Validation" resource, but if it isn't there (which is the case in my environment), it doesn't try to use the class loader for the DefaultValidationProviderResolver class.

A workaround for this issue is to set the context class loader to null before calling the buildDefaultValidatorFactory method.

Project: Hibernate Validator
Priority: Major Major
Reporter: Tom Mueller
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira