JSF 2.3, CDI 2.0 | class com.sun.faces.flow.FlowDiscoveryCDIHelper is deprecated from CDI 1.1

4k views Asked by At

Configured a maven webapp for JSF 2.3, CDI 2 on Tomcat 8.5 with WELD 3.

Cant figure out, how to fix this WARN-message:

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!

pom.xml

    <!-- JSF -->
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>javax.faces-api</artifactId>
        <version>2.3</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>2.4.0</version>
    </dependency>

    <!-- CDI -->
    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>2.0</version>
    </dependency>

As described here: https://docs.oracle.com/javaee/7/api/javax/enterprise/inject/spi/BeforeBeanDiscovery.html#addAnnotatedType-javax.enterprise.inject.spi.AnnotatedType-java.lang.String-

This method is deprecated from CDI 1.1 and addAnnotatedType(AnnotatedType, String) should be used instead.

Searching this WARN-message brings me to: https://github.com/javaee/glassfish/issues/22094

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.

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.

Someone an idea how to fix that?

0

There are 0 answers