6 Replies Latest reply on Sep 5, 2019 6:46 AM by Jaikiran Pai

    WFLYJSF0016: Failed to inject JSF from slot … with Wildfly 17.0.1

    Adrian Boangiu Newbie

      Hello,

       

      We have a JSF application based on Oracle ADF 12.1.3 framework that uses Mojarra 2.1.7 as default JSF impementation. It was deployed successfully on Wildfly 10.1.0 Final (which comes with JSF 2.2.13) and for this we configured JSF as described in the Admin Guide of Wildfly 10 (https://docs.jboss.org/author/display/WFLY10/JSF+Configuration#JSFConfiguration-InstallinganewJSFimplementationmanually).

       

      We migrated successfully this application on Wildfly 17.0.1 using the exact same slots mojarra-2.1.7 for the modules com.sun.jsf-impl and javax.faces.api as those used in Wildfly 10.1.0 and changing only the slot mojarra-2.1.7 of the module org.jboss.as.jsf-injection (to use the weld version and the jsf injection of Wildfly 17.0.1).

       

      After this, we have changed the framework of our application to Oracle ADF 12.2.1.3 that uses Mojarra 2.2.8.21. We succeed to deploy and run this new version on Wildfly 10.1 without configuring at all the JSF subsystem.

       

      At this point started our problems.

       

      Oracle ceased to provide jsf-api and jsf-impl jars in this new version of the framework.  So we used two approaches to get these jars:

      1. Download them from http://central.maven.org/maven2/com/sun/faces/jsf-api/ and http://central.maven.org/maven2/com/sun/faces/jsf-impl/.
      2. Obtain them from the glassfish.jsf.jar provided by Oracle ADF as described here https://stackoverflow.com/questions/35899887/how-to-install-one-jar-variant-of-jsf-2-3-javax-faces-jar-on-wildfly

       

      We then configured the JSF as described in Admin Guide of Wildfly 17 (https://docs.wildfly.org/17/Admin_Guide.html#JSF) but we are unable to deploy the application. We get the same error no matter which pair of jsf-api and jsf-impl jars we use:

      15:53:36,374 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3)  MSC000001: Failed to start service jboss.deployment.unit."coswin.war".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."coswin.war".DEPENDENCIES: WFLYSRV0153: Failed to process phase DEPENDENCIES of deployment "coswin.war"

      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183) [wildfly-server-9.0.2.Final.jar:9.0.2.Final]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1737) [jboss-msc-1.4.8.Final.jar:1.4.8.Final]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1699) [jboss-msc-1.4.8.Final.jar:1.4.8.Final]

      at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1557) [jboss-msc-1.4.8.Final.jar:1.4.8.Final]

      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) [jboss-threads-2.3.3.Final.jar:2.3.3.Final]

      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982) [jboss-threads-2.3.3.Final.jar:2.3.3.Final]

      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) [jboss-threads-2.3.3.Final.jar:2.3.3.Final]

      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) [jboss-threads-2.3.3.Final.jar:2.3.3.Final]

      at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_221]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJSF0016: Failed to inject JSF from slot mojarra-2.2.8.21

      at org.jboss.as.jsf.deployment.JSFDependencyProcessor.addJSFInjection(JSFDependencyProcessor.java:156)

      at org.jboss.as.jsf.deployment.JSFDependencyProcessor.deploy(JSFDependencyProcessor.java:97)

      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176) [wildfly-server-9.0.2.Final.jar:9.0.2.Final]

      ... 8 more

       

       

      15:53:36,427 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)  WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "coswin.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"coswin.war\".DEPENDENCIES" => "WFLYSRV0153: Failed to process phase DEPENDENCIES of deployment \"coswin.war\"

          Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJSF0016: Failed to inject JSF from slot mojarra-2.2.8.21"}}

      I attach the log of the server (in DEBUG mode) in which we can see that 3 implementations of JSF are known:  mojarra-2.2.8.21, mojarra-2.1.7, main (the same error we get if only 2 implementations are known mojarra-2.2.8.21 and main).

       

      15:53:09,633 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 58)  WFLYJSF0007: Activated the following JSF Implementations: [mojarra-2.2.8.21, mojarra-2.1.7, main]

       

      Googling for WFLYJSF0016 was of no help.

       

      Does anybody know what is the cause of this error?

       

      Thank you

        • 1. Re: WFLYJSF0016: Failed to inject JSF from slot … with Wildfly 17.0.1
          Jaikiran Pai Master

          Can you post the directory listing of the WFLY_HOME/modules/system/layers/base/org/jboss/as/jsf-injection directory? And then paste the contents of each of the module.xml file(s) that are part of this and its subdirectories.

          • 2. Re: WFLYJSF0016: Failed to inject JSF from slot … with Wildfly 17.0.1
            Adrian Boangiu Newbie

            In WFLY_HOME/modules/system/layers/base/org/jboss/as/jsf-injection I got only the standard original files.

            My slots are in WFLY_HOME/modules/org/jboss/as/jsf-injection. They are mojarra-2.1.7 and mojarra-2.2.8.21

             

            The module.xml for mojarra-2.1.7 is:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <module xmlns="urn:jboss:module:1.5" name="org.jboss.as.jsf-injection" slot="mojarra-2.1.7">

                <properties>

                    <property name="jboss.api" value="private"/>

                </properties>

                <resources>

                    <resource-root path="wildfly-jsf-injection-17.0.1.Final.jar"/>

                    <resource-root path="weld-jsf-3.1.1.Final.jar"/>

                    <!-- Insert resources here -->

                </resources>

                <dependencies>

                    <module name="com.sun.jsf-impl" slot="mojarra-2.1.7"/>

                    <module name="javax.api"/>

                    <module name="org.jboss.as.web-common"/>

                    <module name="javax.servlet.api"/>

                    <module name="org.jboss.as.ee"/>

                    <module name="javax.enterprise.api"/>

                    <module name="org.jboss.logging"/>

                    <module name="org.jboss.weld.core"/>

                    <module name="javax.faces.api" slot="mojarra-2.1.7"/>

                </dependencies>

            </module>

             

            The module.xml for mojarra-2.2.8.21 is:

            <?xml version="1.0" encoding="UTF-8"?>

            <module xmlns="urn:jboss:module:1.8" name="org.jboss.as.jsf-injection:mojarra-2.2.8.21">

                <properties>

                    <property name="jboss.api" value="private"/>

                </properties>

                <resources>

                    <resource-root path="wildfly-jsf-injection-17.0.1.Final.jar"/>

                    <resource-root path="weld-jsf-3.1.1.Final.jar"/>

                    <!-- Insert resources here -->

                </resources>

                <dependencies>

                    <module name="com.sun.jsf-impl:mojarra-2.2.8.21"/>

                    <module name="javax.api"/>

                    <module name="java.naming"/>

                    <module name="java.desktop"/>

                    <module name="org.jboss.as.ee"/>

                    <module name="org.jboss.as.jsf"/>

                    <module name="org.jboss.as.web-common"/>

                    <module name="javax.servlet.api"/>

                    <module name="javax.enterprise.api"/>

                    <module name="org.jboss.logging"/>

                    <module name="org.jboss.weld.core"/>

                    <module name="org.jboss.weld.api"/>

                    <module name="javax.faces.api:mojarra-2.2.8.21"/>

                </dependencies>

            </module>

             

            Thank you for your help

            • 3. Re: WFLYJSF0016: Failed to inject JSF from slot … with Wildfly 17.0.1
              Jaikiran Pai Master

              The module.xml for mojarra-2.2.8.21 is:

              <?xml version="1.0" encoding="UTF-8"?>

              <module xmlns="urn:jboss:module:1.8" name="org.jboss.as.jsf-injection:mojarra-2.2.8.21">

                  <properties>

                      <property name="jboss.api" value="private"/>

                  </properties>

                  <resources>

                      <resource-root path="wildfly-jsf-injection-17.0.1.Final.jar"/>

                      <resource-root path="weld-jsf-3.1.1.Final.jar"/>

                      <!-- Insert resources here -->

                  </resources>

                  <dependencies>

                      <module name="com.sun.jsf-impl:mojarra-2.2.8.21"/>

                      <module name="javax.api"/>

                      <module name="java.naming"/>

                      <module name="java.desktop"/>

                      <module name="org.jboss.as.ee"/>

                      <module name="org.jboss.as.jsf"/>

                      <module name="org.jboss.as.web-common"/>

                      <module name="javax.servlet.api"/>

                      <module name="javax.enterprise.api"/>

                      <module name="org.jboss.logging"/>

                      <module name="org.jboss.weld.core"/>

                      <module name="org.jboss.weld.api"/>

                      <module name="javax.faces.api:mojarra-2.2.8.21"/>

                  </dependencies>

              </module>

              This file looks incorrect in more than one place.

               

              First:

              <module xmlns="urn:jboss:module:1.8" name="org.jboss.as.jsf-injection:mojarra-2.2.8.21">

               

              should be:

               

              <module xmlns="urn:jboss:module:1.8" name="org.jboss.as.jsf-injection" slot="mojarra-2.2.8.21">

               

              Then some of the dependencies:

              <dependencies>

                      <module name="com.sun.jsf-impl:mojarra-2.2.8.21"/>

              ...

              <module name="javax.faces.api:mojarra-2.2.8.21"/>

              ...

               

              should be :

              <dependencies>

                      <module name="com.sun.jsf-impl" slot="mojarra-2.2.8.21"/>

              ...

              <module name="javax.faces.api" slot="mojarra-2.2.8.21"/>

              ...

              • 4. Re: WFLYJSF0016: Failed to inject JSF from slot … with Wildfly 17.0.1
                Adrian Boangiu Newbie

                I have already tried with the syntax that you suggest since the mojarra-injection-module.xml example file (https://gist.github.com/fjuma/30160f0e95ade328253118c706339604) pointed by the Admin Guide documentation (https://docs.wildfly.org/17/Admin_Guide.html#JSF) use it. I obtained the same error (and I rechecked after receiving your answer with the same results/error).

                 

                I change the syntax because I observed that the mojarra-injection-module.xml example file use urn:jboss:module:1.5  while the mojarra-impl-module.xml example file (https://github.com/wildfly/wildfly/blob/master/jsf/multi-jsf-installer/src/main/resources/mojarra-impl-module.xml) and mojarra-api-module.xml example file pointed by Admin Guide documentation use the other syntax for the slot attribute with urn:jboss:module:1.8.

                 

                I also tried first with the dependencies listed in the mojarra-injection-module.xml example file:

                <dependencies>

                    <module name="com.sun.jsf-impl" slot="${jsf-impl-name}-${jsf-version}"/>

                    <module name="javax.api"/>

                    <module name="org.jboss.as.web-common"/>

                    <module name="javax.servlet.api"/>

                    <module name="org.jboss.as.ee"/>

                    <module name="org.jboss.as.jsf"/>

                    <module name="javax.enterprise.api"/>

                    <module name="org.jboss.logging"/>

                    <module name="org.jboss.weld.core"/>

                 

                    <module name="javax.faces.api" slot="${jsf-impl-name}-${jsf-version}"/>

                </dependencies>

                but I realized that these dependencies are for the resources listed in the example file:

                <resources>

                <resource-root path="wildfly-jsf-injection-${version.jboss.as}.jar"/>

                <resource-root path="weld-core-jsf-${version.weld.core}.jar"/>

                </resources>

                and these resources seem to come from an old version of wildfly (10 for example) because the actual resources of jsf-injection in wildfly 17 are:

                <resources>

                <resource-root path="wildfly-jsf-injection-17.0.1.Final.jar"/>

                <resource-root path="weld-jsf-3.1.1.Final.jar"/>

                </resources>

                (there is no longer weld-core-jsf….jar).

                 

                That is why I took the dependencies of jsf-injection in wildfly 17

                <module name="com.sun.jsf-impl"/>

                <module name="java.naming"/>

                <module name="java.desktop"/>

                <module name="org.jboss.as.ee"/>

                <module name="org.jboss.as.jsf"/>

                <module name="org.jboss.as.web-common"/>

                <module name="javax.servlet.api"/>

                <module name="javax.enterprise.api"/>

                <module name="org.jboss.logging"/>

                <module name="org.jboss.weld.core"/>

                <module name="org.jboss.weld.api"/>

                 

                <!-- added this for MyFacesAnnotationProvider -->

                <module name="javax.faces.api"/>

                and adapted them by using the mojarra slot for com.sun.jsf-impl and javax.faces.api.

                 

                For me the modules are correctly defined.

                 

                I did a lot of tests with our two applications (the one using mojarra-2.1.7, lets call it cw88 and the one using mojarra-2.2.8.21, lets call it cw89). Here are some strange findings:

                 

                1. By searching “mojarra” in the log attached to the original message (server.log, for the application cw89) I can find:

                15:53:05,714 DEBUG [org.jboss.as.jsf] (ServerService Thread Pool -- 19) Activating JSF(Mojarra) Extension

                15:53:09,633 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 58)  WFLYJSF0007: Activated the following JSF Implementations: [mojarra-2.2.8.21, mojarra-2.1.7, main]

                15:53:20,166 DEBUG [org.jboss.modules] (MSC service thread 1-3)  Module com.sun.jsf-impl:mojarra-2.1.7 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                15:53:20,283 DEBUG [org.jboss.modules] (MSC service thread 1-3)  Module javax.faces.api:mojarra-2.1.7 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                 

                and just before the error the following line

                 

                15:53:36,371 DEBUG [org.jboss.modules] (MSC service thread 1-3)  Module org.jboss.as.jsf-injection:mojarra-2.2.8.21 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                 

                For me this is strange because I don’t see why the mojarra-2.1.7 implementation and api were loaded (and not also the mojarra-2.2.8.21).

                 

                2. If I remove the implementation mojarra-2.1.7 from the server, start it and search “mojarra” in the log (log file server.cw89.mojarra-2.2.8.21.log attached) I can find only:

                11:04:01,039 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 58)  WFLYJSF0007: Activated the following JSF Implementations: [mojarra-2.2.8.21, main]

                11:04:25,878 DEBUG [org.jboss.modules] (MSC service thread 1-6)  Module org.jboss.as.jsf-injection:mojarra-2.2.8.21 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                 

                and the error

                 

                Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJSF0016: Failed to inject JSF from slot mojarra-2.2.8.21

                 

                Strange!!!

                 

                3. If I start the server only with the mojarra-2.1.7 and the application using it cw88 I find in the log (file server.cw88.mojarra-2.1.7.log attached) the following lines:

                10:16:56,358 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 58)  WFLYJSF0007: Activated the following JSF Implementations: [mojarra-2.1.7, main]

                10:17:05,130 DEBUG [org.jboss.modules] (MSC service thread 1-1)  Module com.sun.jsf-impl:mojarra-2.1.7 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                10:17:05,155 DEBUG [org.jboss.modules] (MSC service thread 1-1)  Module javax.faces.api:mojarra-2.1.7 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                10:17:19,363 DEBUG [org.jboss.modules] (MSC service thread 1-5)  Module org.jboss.as.jsf-injection:mojarra-2.1.7 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                 

                If I start the server with 2 implementations of mojarra (mojarra-2.1.7 and mojarra-2.2.8.21) and the application cw88 using mojarra-2.1.7 I find in the log (file server.cw88.mojarra-2.1.7_2.2.8.21.log attached) the following lines:

                10:29:23,598 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 58)  WFLYJSF0007: Activated the following JSF Implementations: [mojarra-2.2.8.21, mojarra-2.1.7, main]

                10:29:32,415 DEBUG [org.jboss.modules] (MSC service thread 1-7)  Module com.sun.jsf-impl:mojarra-2.1.7 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                10:29:32,421 DEBUG [org.jboss.modules] (MSC service thread 1-7)  Module javax.faces.api:mojarra-2.1.7 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                10:29:47,541 DEBUG [org.jboss.modules] (MSC service thread 1-3)  Module org.jboss.as.jsf-injection:mojarra-2.1.7 defined by local module loader @cd2dae5 (finder: local module finder @3a883ce7 (roots: C:\siv718\wildfly-17.0.1.Final\modules,C:\siv718\wildfly-17.0.1.Final\modules\system\layers\base))

                 

                These 2 logs for the application cw88 with the server containing one or two mojarra implementations are coherent.

                 

                4. If I link the application cw88 with mojarra-2.2.8.21 instead of mojarra-2.1.7 I have the same error and log “structure” as for using the application cw89 linked with mojarra-2.2.8.21.

                • 5. Re: WFLYJSF0016: Failed to inject JSF from slot … with Wildfly 17.0.1
                  Adrian Boangiu Newbie

                  I have found the error. It was in the module.xml of the slot jsf-impl/mojarra-2.2.8.21. The name of the slot was wrong

                   

                  <module xmlns="urn:jboss:module:1.8" name="com.sun.jsf-impl:mojarra-2.2.8.11">

                  • 6. Re: WFLYJSF0016: Failed to inject JSF from slot … with Wildfly 17.0.1
                    Jaikiran Pai Master

                    adrian.boangiu  wrote:

                     

                    I have already tried with the syntax that you suggest since the mojarra-injection-module.xml example file (https://gist.github.com/fjuma/30160f0e95ade328253118c706339604) pointed by the Admin Guide documentation (https://docs.wildfly.org/17/Admin_Guide.html#JSF) use it. I obtained the same error (and I rechecked after receiving your answer with the same results/error).

                    I change the syntax because I observed that the mojarra-injection-module.xml example file use urn:jboss:module:1.5  while the mojarra-impl-module.xml example file (https://github.com/wildfly/wildfly/blob/master/jsf/multi-jsf-installer/src/main/resources/mojarra-impl-module.xml) and mojarra-api-module.xml example file pointed by Admin Guide documentation use the other syntax for the slot attribute with urn:jboss:module:1.8.

                    It's likely that JBoss Modules now supports this new syntax. I might have been wrong then, in my previous reply.

                     

                    Coming back to the issue at hand, the only way I can think of, of getting the real reason for the failure is using a locally built WildFly version which contains this (proposed) patch WFLY-12487 Include the original cause of failure, if jsf-injection module load fails by jaikiran · Pull Request #12588 ·…

                    Is that something you would be able to do?