How do you migrate to MyFaces on WildFly 27/2?

120 views
Skip to first unread message

Roger Lee

unread,
Jun 7, 2023, 9:49:24 AM6/7/23
to WildFly
Trying to migrate to MyFaces from Mojarra:

From:  WildFly 28.0.1.Final 'preview' 

Currently getting:

14:17:35,094 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "NOTiFYmoto.ear" (runtime-name: "NOTiFYmoto.ear")

14:17:37,813 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0207: Starting subdeployment (runtime-name: "NOTiFYmotoJAR.jar")

14:17:37,813 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0207: Starting subdeployment (runtime-name: "NOTiFYmotoWAR.war")

14:17:40,077 WARN  [org.jboss.as.jsf] (MSC service thread 1-6) WFLYJSF0005: Unknown Jakarta Server Faces version 'myfaces-4.0.0'.  Default version 'myfaces-impl-4.0.0' will be used instead.

14:17:40,079 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."NOTiFYmoto.ear".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."NOTiFYmoto.ear".DEPENDENCIES: WFLYSRV0153: Failed to process phase DEPENDENCIES of deployment "NOTiFYmoto.ear"

at org.jboss...@20.0.2.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)

at org.jb...@1.5.0.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1590)

at org.jb...@1.5.0.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1553)

at org.jb...@1.5.0.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1411)

at org.jbos...@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)

at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)

at org.jbos...@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)

at java.base/java.lang.Thread.run(Thread.java:1623)

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJSF0014: Default Jakarta Server Faces implementation slot 'myfaces-impl-4.0.0' is invalid

at org.jbos...@28.0.1.Final//org.jboss.as.jsf.deployment.JSFDependencyProcessor.deploy(JSFDependencyProcessor.java:94)

at org.jboss...@20.0.2.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)

... 8 more


14:17:40,083 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "NOTiFYmoto.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"NOTiFYmoto.ear\".DEPENDENCIES" => "WFLYSRV0153: Failed to process phase DEPENDENCIES of deployment \"NOTiFYmoto.ear\"

    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJSF0014: Default Jakarta Server Faces implementation slot 'myfaces-impl-4.0.0' is invalid"}}

14:17:40,084 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "NOTiFYmoto.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"NOTiFYmoto.ear\".DEPENDENCIES" => "WFLYSRV0153: Failed to process phase DEPENDENCIES of deployment \"NOTiFYmoto.ear\"

    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJSF0014: Default Jakarta Server Faces implementation slot 'myfaces-impl-4.0.0' is invalid"}}

14:17:40,086 ERROR [org.jboss.as.server] (External Management Request Threads -- 1) WFLYSRV0021: Deploy of deployment "NOTiFYmoto.ear" was rolled back with the following failure message: 

{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"NOTiFYmoto.ear\".DEPENDENCIES" => "WFLYSRV0153: Failed to process phase DEPENDENCIES of deployment \"NOTiFYmoto.ear\"

    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJSF0014: Default Jakarta Server Faces implementation slot 'myfaces-impl-4.0.0' is invalid"}}

 

Instructions for installing MyFaces 4.x as an alternative to Mojarra JSF


1. Create WildFly on my MacOS using 'Cellar':

 /usr/local/Cellar/wildfly-as/wildfly-preview-28.0.1.Final


2. Copy & Create:

 /usr/local/Cellar/wildfly-as/wildfly-preview-28.0.1.Final.MyFaces


3. Copy into:

 ../wildfly-preview-28.0.1.Final.MyFaces/modules/system/layers/base/com/sun/jsf-impl/myfaces-impl-4.0.0/


  Add: 'myfaces-api-4.0.1.jar'

   module.xml
  myfaces-impl-4.0.1.jar

4. Copy into:

    ./wildfly-preview-28.0.1.Final.MyFaces/modules/system/layers/base/javax/faces/api/myfaces-impl-4.0.0/


     module.xml
     myfaces-api-4.0.1.jar


5. Copy into

 ../wildfly-preview-28.0.1.Final.MyFaces/modules/system/layers/base/org/apache/commons/digester/main/


  module.xml
  commons-digester3-3.2.jar

     

6. Copy into:

 ./wildfly-preview-28.0.1.Final.MyFaces/modules/system/layers/base/org/jboss/as/jsf-injection/myfaces-impl-4.0.0/


    module.xml
    weld-jsf-5.1.0.Final.jar
   wildfly-jsf-injection-28.0.1.Final.jar

7. Run the commandL

    ./standalone.sh -b 0.0.0.0 --server-config=standalone-full.xml


   The server should start without errors.

 8. Open another terminal:

    cd /usr/local/Cellar/wildfly-as/wildfly-preview-28.0.1.Final.MyFaces/bin

    run:
   ./jboss-cli.sh


9. If shows:

  You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported          commands.[disconnected /]
   connect


10. Run:  ./subsystem=jsf:list-active-jsf-impls()

   Result should look as follows:  

    {
       "outcome" => "success",
       "result" => [
           "myfaces-impl-4.0.0",
            "main"
       ]
    }


11. If you see this result (#10), then run:

    ./subsystem=jsf/:write-attribute(name=default-jsf-impl-slot,value=myfaces-impl-4.0.0)
    {
        "outcome" => "success",
        "response-headers" => {
            "operation-requires-reload" => true,
            "process-state" => "reload-required"
        }
    }

12. Restart the server (#7) from first terminal:
  
    ./standalone.sh -b 0.0.0.0 --server-config=standalone-full.xml
Reply all
Reply to author
Forward
0 new messages