title: bean-validation validation.xml ignored
body: <p>I am using JSR 303 Bean validation in my JSF 2.0 web application and it works fine with annotations. Now I would like to ignore annotations and configure validation rules using the <strong>validation.xml</strong> file, so this is what I did (I am using an eclipse dynamic web project) :</p>
  
  <ol>
  <li><p>Added <strong>validation.xml</strong> under <strong>WebContent/META-INF/validation.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;validation-config
  xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.0.xsd"
  &gt;
  
    &lt;constraint-mapping&gt;META-INF/validation/constraint-mapping.xml&lt;/constraint-mapping&gt;
  
  &lt;/validation-config&gt;
  </code></pre></li>
  <li><p>Then created the file <strong>constraint-mapping.xml</strong> under <strong>WebContent/META-INF/validation/constraint-mapping.xml</strong></p>
  
  <pre><code>&lt;constraint-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/mapping validation-mapping-1.0.xsd"
               xmlns="http://jboss.org/xml/ns/javax/validation/mapping"&gt;
  
  &lt;bean class="my.full.path.ValidationMB" ignore-annotations="true"&gt;
  
  &lt;/bean&gt;
  
  &lt;/constraint-mappings&gt;
  </code></pre></li>
  </ol>
  
  <p>Having these configurations in place, I suppose the annotations in my bean class ValidationMB shall be ignored, <strong>BUT this is not happening!</strong>, which makes me assume that the validation.xml file is not being loaded.</p>
  
  <p>any ideas? thanks.</p>
  
  <p><strong>Environment:</strong></p>
  
  <ol>
  <li>Apache Tomcat 7.0.23</li>
  <li>javax.faces-2.1.4.jar</li>
  <li>hibernate-validator-4.2.0.Final.jar</li>
  <li>hibernate-validator-annotation-processor-4.2.0.Final.jar</li>
  <li>validation-api-1.0.0.GA.jar </li>
  <li>slf4j-api-1.6.1.jar</li>
  </ol>
  
  <p><strong>From the spec: section 4.4.6. XML Configuration: META-INF/validation.xml</strong></p>
  
  <blockquote>
    <p>Unless explicitly ignored by calling
    Configuration.ignoreXMLConfiguration(), a Configuration takes into
    account the configuration available in META-INF/validation.xml. This
    configuration file is optional but can be used by applications to
    refine some of the Bean Validation behavior. If more than one
    META-INF/validation.xml file is found in the classpath, a
    ValidationException is raised.</p>
  </blockquote>