title: Exclude module not working in JBoss 7.2.1
body: <p>In my project we are using validation-api:1.1.0.Final and our project is standard maven web based project. When I am deploying the war to JBOSS it is giving us the following error</p>
  
  <pre><code>Caused by: java.lang.NoSuchMethodError: javax.validation.Configuration.parameterNameProvider(Ljavax/validation/ParameterNameProvider;)Ljavax/validation/Configuration;
             at org.apache.cxf.validation.BeanValidationProvider.initFactoryConfig(BeanValidationProvider.java:102) [cxf-core-3.0.2.jar:3.0.2]
             at org.apache.cxf.validation.BeanValidationProvider.&lt;init&gt;(BeanValidationProvider.java:59) [cxf-core-3.0.2.jar:3.0.2]
             at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_27]
             at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [rt.jar:1.6.0_27]
             at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [rt.jar:1.6.0_27]
             at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [rt.jar:1.6.0_27]
             at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
  </code></pre>
  
  <p>Seems like JBOSS is inserting its own validation-api-1.0.0.GA-redhat-2 jar and which is causing the issue.</p>
  
  <p>I have tried to below jboss-deployment-structure.xml file and placed it inside WEB-INF/ dir but it does not work</p>
  
  <pre><code>&lt;jboss-deployment-structure&gt;
   &lt;deployment&gt;
       &lt;exclusions&gt;
              &lt;module name="javax.validation.api" /&gt;
       &lt;/exclusions&gt;
   &lt;/deployment&gt;
  &lt;/jboss-deployment-structure&gt;
  </code></pre>
  
  <p>I am using JBoss EAP 6.1.1.GA (AS 7.2.1.Final-redhat-10)</p>
  
  <p>Maven</p>
  
  <pre><code>&lt;!-- Validation using Annotations --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;javax.validation&lt;/groupId&gt;
      &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
      &lt;version&gt;1.1.0.Final&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
      &lt;version&gt;5.1.1.Final&lt;/version&gt;
      &lt;!-- &lt;scope&gt;provided&lt;/scope&gt; --&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.web&lt;/groupId&gt;
      &lt;artifactId&gt;javax.el&lt;/artifactId&gt;
      &lt;version&gt;2.2.4&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>javax module</p>
  
  <pre><code>&lt;module xmlns="urn:jboss:module:1.1" name="javax.validation.api"&gt;
    &lt;resources&gt;
        &lt;resource-root path="validation-api-1.1.0.Final.jar"/&gt;
        &lt;!-- Insert resources here --&gt;
    &lt;/resources&gt;
  
    &lt;dependencies&gt;
      &lt;module name="org.jboss.logging"/&gt;
    &lt;/dependencies&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>I have been struggling to get it through. Any help would be highly appreciated.</p>