title: JSF 2.3, CDI 2.0 | class com.sun.faces.flow.FlowDiscoveryCDIHelper is deprecated from CDI 1.1
body: <p>Configured a maven webapp for JSF 2.3, CDI 2 on Tomcat 8.5 with WELD 3.</p>
  
  <p>Cant figure out, how to fix this WARN-message:</p>
  
  <blockquote>
    <p>WARN  o.j.w.Bootstrap [addAnnotatedType:118] WELD-000146:
    BeforeBeanDiscovery.addAnnotatedType(AnnotatedType) used for class
    com.sun.faces.flow.FlowDiscoveryCDIHelper is deprecated from CDI 1.1!</p>
  </blockquote>
  
  <p>pom.xml</p>
  
  <pre><code>    &lt;!-- JSF --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.faces&lt;/groupId&gt;
          &lt;artifactId&gt;javax.faces-api&lt;/artifactId&gt;
          &lt;version&gt;2.3&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish&lt;/groupId&gt;
          &lt;artifactId&gt;javax.faces&lt;/artifactId&gt;
          &lt;version&gt;2.4.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- CDI --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.enterprise&lt;/groupId&gt;
          &lt;artifactId&gt;cdi-api&lt;/artifactId&gt;
          &lt;version&gt;2.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>As described here:
  <a href="https://docs.oracle.com/javaee/7/api/javax/enterprise/inject/spi/BeforeBeanDiscovery.html" rel="nofollow noreferrer">https://docs.oracle.com/javaee/7/api/javax/enterprise/inject/spi/BeforeBeanDiscovery.html#addAnnotatedType-javax.enterprise.inject.spi.AnnotatedType-java.lang.String-</a></p>
  
  <p>This method is deprecated from CDI 1.1 and addAnnotatedType(AnnotatedType, String) should be used instead. </p>
  
  <p>Searching this WARN-message brings me to:
  <a href="https://github.com/javaee/glassfish/issues/22094" rel="nofollow noreferrer">https://github.com/javaee/glassfish/issues/22094</a></p>
  
  <p>It´s a little bit different, cause he dont get the FacesContext injected, but the stacktrace has amongst other entries the same message like me.</p>
  
  <p>As described there, I now use a "ConfigurationBean.java" to use really JSF 2.3 and set the [beans.xml] to [bean-discovery-mode="all"]. But as this is only for @Inject FacesContext, the WARN-message is still there.</p>
  
  <p>Someone an idea how to fix that?</p>