0 Replies Latest reply on Apr 16, 2019 10:33 AM by Fadv Fadv

    Installing a JSF myfaces Implementation

    Fadv Fadv Newbie

      I have installed myFaces 2.2.12 implementation using templates linked on Wildfly Admin Guide. These templates do not use the slot attribute. With the format, without slot attribute how do I reference this module in jboss-deployment-structure.xml? I tried "javax.faces.api:myfaces-2.2.12" but get error "org.jboss.modules.ModuleNotFoundException: javax.faces.api\:myfaces-2.2.12"

       

      <module xmlns="urn:jboss:module:1.8" name="com.sun.jsf-impl:${jsf-impl-name}-${jsf-version}">

      ...

       

      </module>

       

      E.g jboss-eap-7.2\modules\javax\faces\api\myfaces-2.2.12

      <?xml version="1.0" encoding="UTF-8"?>
      <module xmlns="urn:jboss:module:1.8" name="javax.faces.api:myfaces-2.2.12">
          <dependencies>
              <module name="javax.enterprise.api" export="true"/>
              <module name="javax.servlet.api" export="true"/>
              <module name="javax.servlet.jsp.api" export="true"/>
              <module name="javax.servlet.jstl.api" export="true"/>
              <module name="javax.validation.api" export="true"/>
              <module name="org.glassfish.javax.el" export="true"/>
              <module name="javax.api"/>
      
      
          </dependencies>
          <resources>
              <resource-root path="myfaces-api-2.2.12.jar"/>
          </resources>
      </module>
      
      
          

       

      My jboss-deployment-structure.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
          <!-- Warning setting to true causes NoClassFoundException's when 
          the NistMailHandler is created. 
          -->
          <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
          <deployment>
              <dependencies>
                  <module name="com.fadv.fp" export="true"/><!-- folder with Application.properties -->
                  <module name="com.oracle.ojdbc14" export="true"/>
                  <module name="org.dom4j" export="true"/>
                  <module name="org.quartz" export="true"/>
                  <module name="org.picketbox" export="true"/><!-- Contains the org.jboss.security.auth for login -->
                  <module name="org.infinispan" export="true"/>
                  <module name="org.infinispan.commons" export="true"/>
                  <module name="org.apache.log4j" export="true"/>
                  <module name="org.apache.velocity" export="true"/>
                  <module name="org.apache.commons.codec" export="true"/>
                  <module name="org.apache.httpcomponents" export="true"/>
                  <module name="org.apache.xerces" export="true"/>
                  <module name="org.apache.commons.beanutils" export="true"/>
                  <module name="org.apache.commons.digester" export="true"/>
                  <module name="org.apache.commons.io" export="true"/>
                  <module name="org.apache.commons.collections" export="true"/>
              </dependencies>
              <exclusions>
                  <module name="javax.faces.api" slot="main" />
                  <module name="com.sun.jsf-impl" slot="main" />
                  <module name="org.jboss.as.jsf-injection" slot="main" />
              </exclusions>
          </deployment>
          <sub-deployment name="netmark.war">
              <dependencies>
                  <module name="javax.faces.api:myfaces-2.2.12" export="true"/>
                  <module name="com.sun.jsf-impl:myfaces-2.2.12" export="true"/>
                  <module name="org.jboss.as.jsf-injection:myfaces-2.2.12" export="true"/>        
              </dependencies>
          </sub-deployment>
          
      </jboss-deployment-structure>
      

       

       

      When I deploy:

       

      2019-04-16 08:42:24,861 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.module.service."deployment.bls.ear.netmark.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.bls.ear.netmark.war".main: WFLYSRV0179: Failed to load module: deployment.bls.ear.netmark.war
      at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:89)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
      at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: org.jboss.modules.ModuleNotFoundException: javax.faces.api\:myfaces-2.2.12
      at org.jboss.modules.Module.addPaths(Module.java:1266)
      at org.jboss.modules.Module.link(Module.java:1622)
      at org.jboss.modules.Module.relinkIfNecessary(Module.java:1650)
      at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:296)
      at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:280)
      at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:66)
      ... 8 more

       

      I tried adding to web.xml:

       

          
              org.jboss.jbossfaces.JSF_CONFIG_NAME
              myfaces-2.2.12
          

       

      But get error ("Failed to inject JSF from slot myfaces-2.2.12") :

       

      2019-04-16 09:20:50,720 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."bls.ear".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."bls.ear".DEPENDENCIES: WFLYSRV0153: Failed to process phase DEPENDENCIES of deployment "bls.ear" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:151) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738) at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700) at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378) at java.lang.Thread.run(Thread.java:748) Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJSF0016: Failed to inject JSF from slot myfaces-2.2.12 at org.jboss.as.jsf.deployment.JSFDependencyProcessor.addJSFInjection(JSFDependencyProcessor.java:154) at org.jboss.as.jsf.deployment.JSFDependencyProcessor.deploy(JSFDependencyProcessor.java:95) at org.jboss

       

      Why would injection fail?