title: JBoss AS 7.1.1 not picking up my JSF implementation
body: <p>When I deploy my .war file in JBoss AS 7.1.1 and call  </p>
  
  <pre><code>FacesContext.class.getPackage().getImplementationTitle() 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>FacesContext.class.getPackage().getImplementationVersion()
  </code></pre>
  
  <p>I get a different version then when I deploy it on tomcat.</p>
  
  <p>JBoss:     JSF JavaServer Faces API 2.0.1.Final</p>
  
  <p>Tomcat:    JSF Mojarra 2.0.6-FCS</p>
  
  <p>It seems JBoss is not picking the correct JARs that I have in my <code>WEB-INF\lib\</code>.
  This causes different behaviour in my website. 
  I tried to solve the problem with</p>
  
  <pre><code>&lt;context-param&gt;
     &lt;param-name&gt;org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL&lt;/param-name&gt;
     &lt;param-value&gt;true&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>But that didn't work. I read <a href="https://stackoverflow.com/questions/7080081/alternative-jsf-implementation-with-jboss-71">Alternative JSF implementation with JBoss 71</a> but apparently it is not solved in 7.1.1.</p>
  
  <p>I added <code>jboss-deployment-structure.xml</code> to <code>WEB-INF\</code> with the following content. </p>
  
  <pre><code>&lt;jboss-deployment-structure&gt; 
  &lt;deployment&gt;
      &lt;exclusions&gt;
        &lt;module name="javax.faces.api" slot="main"/&gt;
        &lt;module name="com.sun.jsf-impl" slot="main"/&gt;
      &lt;/exclusions&gt;
      &lt;dependencies&gt;
        &lt;module name="org.apache.commons.logging" /&gt;
        &lt;module name="org.apache.commons.collections" /&gt;
        &lt;module name="org.apache.log4j" /&gt;
        &lt;module name="org.dom4j" /&gt;
        &lt;module name="javax.faces.api" slot="1.2"/&gt;
        &lt;module name="com.sun.jsf-impl" slot="1.2"/&gt;
      &lt;/dependencies&gt;
    &lt;/deployment&gt;   
  &lt;/jboss-deployment-structure&gt;
  </code></pre>
  
  <p>But then my app is not deployed and I get the following errors in <code>server.log</code>:</p>
  
  <pre><code>14:06:14,733 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Critical error during deployment: : com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
  at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:357) [jsf-impl.jar:2.0.6-FCS]
  </code></pre>
  
  <p>How can I solve my problem?</p>