title: Weblogic 12c HibernateValidator ClassLoading issue
body: <p>Validation framework which has been rolled up as part of the JEE6 spec (WL12).  Both the WL10 and WL12 versions of our application were deployed with the following open source libraries:</p>
  
  <ol>
  <li>JSR-303 / validation-api.jar  (version 1.0)</li>
  <li>Hibernate Validator (version 4.2.0)</li>
  </ol>
  
  <p>However, the libraries are also bundled with WL 12 (modules directory).  Note that the Hibernate Validator version is slightly different.</p>
  
  <ol>
  <li>modules.javax.validation_1.0.0.jar  </li>
  <li>hibernate.validator_4.1.0.jar</li>
  </ol>
  
  <p>With our WL12 run we are getting below exception:</p>
  
  <pre><code>javax.validation.ValidationException: Unable to get available provider 
  </code></pre>
  
  <p>Attempted Solutions
  Our next attempt was to use the WebLogic FilteringClassLoader to prefer the libraries from our application (APP-INF/lib directory) by specifying them in the weblogic-application.xml file (i.e. choose our versions over WebLogic’s). We were already doing this for several other open source libraries in WL10:</p>
  
  <pre><code>&lt;prefer-application-packages&gt;
    &lt;package-name&gt;com.google.common.*&lt;/package-name&gt;    
    &lt;package-name&gt;org.apache.commons.lang.*&lt;/package-name&gt;
    &lt;package-name&gt;org.apache.commons.logging.*&lt;/package-name&gt;
    &lt;package-name&gt;org.apache.commons.beanutils.*&lt;/package-name&gt;
    &lt;package-name&gt;org.apache.commons.collections.*&lt;/package-name&gt;
    &lt;package-name&gt;antlr.*&lt;/package-name&gt;
    &lt;package-name&gt;javax.validation.*&lt;/package-name&gt;
    &lt;package-name&gt;org.hibernate.validator.*&lt;/package-name&gt;
  &lt;/prefer-application-packages&gt;
  </code></pre>
  
  <p>After making that change, our application experienced the following run-time error trying to process any request that makes use of the validation framework:</p>
  
  <pre><code>javax.validation.ValidationException: Unable to get available provider resolvers.
      at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:259)
      at web20.hibernate.validation.ValidatorFactoryConfigurator.getValidatorFactory(ValidatorFactoryConfigurator.java:39)
      at web20.hibernate.validation.ValidationHandlerImpl.handleHibernateValidations(ValidationHandlerImpl.java:180)
      at web20.hibernate.validation.ValidationHandlerImpl.performValidation(ValidationHandlerImpl.java:255)
      at web20.hibernate.validation.ValidationHandlerImpl.validateAndFormatMessages(ValidationHandlerImpl.java:302)
      at web20.hibernate.validation.ValidationHandlerImpl.validateUsingHibernateGroups(ValidationHandlerImpl.java:113)
      at service.serviceapp.performValidations(serviceapp.java:392)
      at service.serviceapp.performValidations(serviceapp.java:379)
      at service.TransactionalServiceImpl.search(TransactionalServiceImpl.java:300)
  </code></pre>