3 Replies Latest reply on May 26, 2012 7:35 PM by hantsy bai

    How to use Myfaces 2.1.3 On Jboss 7

    hantsy bai Master

      I want to try Myfaces 2.1.3 on JBoss 7, but JBoss 7 does not ship with myfaces.

       

       

      I  excluded the official jsf modules in my project jboss-deployment-structure.xml file.

       

       

      <exclusions>
                  <module name="javax.faces.api" slot="main" />
                  <module name="com.sun.jsf-impl" slot="main" />
              </exclusions>
      

       

       

      And add the myfaces-api and myfaves-impl in my pom.xml.

       

      But when I deployed the application into JBoss 7, I encountered an exception like this.

       

       

      15:25:36,596 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."siorc.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."siorc.war".INSTALL: Failed to process phase INSTALL of deployment "siorc.war"
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]
          at java.lang.Thread.run(Thread.java:662) [:1.6.0_29]
      Caused by: java.lang.RuntimeException: Failed to load class com.sun.faces.config.ConfigureListener
          at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:141)
          at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:122)
          at org.jboss.as.ee.component.LazyValue.get(LazyValue.java:40)
          at org.jboss.as.ee.component.EEApplicationDescription.getClassConfiguration(EEApplicationDescription.java:183)
          at org.jboss.as.ee.component.ComponentDescription.createConfiguration(ComponentDescription.java:153)
          at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:70)
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
          ... 5 more
      Caused by: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener from [Module "deployment.siorc.war:main" from Service Module Loader]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
          at java.lang.Class.forName0(Native Method) [:1.6.0_29]
          at java.lang.Class.forName(Class.java:247) [:1.6.0_29]
          at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:139)
          ... 11 more
      

       

       

      Is there someone using MyFaces on JBoss7?

        • 1. Re: How to use Myfaces 2.1.3 On Jboss 7
          hantsy bai Master

          There is noboday using MyFaces on JBoss 7?

           

          I have tried to add myfaces-api and myfaces-impl modules in JBoss 7 modules folder.

           

           

          <module xmlns="urn:jboss:module:1.0" name="org.apache.myfaces-api">
              <dependencies>
                  <module name="javax.el.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"/>
              </dependencies>
          
              <resources>
                  <resource-root path="myfaces-api-2.1.4.jar"/>
                  <!-- Insert resources here -->
              </resources>
          </module>
          

           

           


           

           

          <module xmlns="urn:jboss:module:1.0" name="org.apache.myfaces-impl">
              <dependencies>
                  <module name="org.apache.myfaces-api"/>
                  <module name="javaee.api"/>
                  <module name="javax.servlet.jstl.api"/>
                  <module name="org.apache.xerces" services="import"/>
                  <module name="org.apache.xalan" services="import"/>
              </dependencies>
          
              <resources>
                  <resource-root path="myfaces-impl-2.1.4.jar"/>
           <resource-root path="commons-beanutils-1.8.3.jar"/>
           <resource-root path="commons-codec-1.3.jar"/>
           <resource-root path="commons-collections-3.2.jar"/>
           <resource-root path="commons-digester-1.8.jar"/>
           <resource-root path="commons-logging-1.1.1.jar"/>
                  <!-- Insert resources here -->
              </resources>
          </module>
          
          
          
          

           

          And the jboss-deployment-structure.xml of the proejct.

           

          <jboss-deployment-structure>
           <deployment>
           <dependencies>
           <module name="org.jboss.logmanager" />
           <!-- <module name="org.dom4j" /> -->
           <module name="org.apache.myfaces-api"/>
           <module name="org.apache.myfaces-impl"/>
           </dependencies>
           <exclusions>
           <module name="javax.faces.api" slot="main" />
           <module name="com.sun.jsf-impl" slot="main" />
           </exclusions>
           </deployment>
          </jboss-deployment-structure>
          

           

          The same result...

          • 2. Re: How to use Myfaces 2.1.3 On Jboss 7
            Tiago Augusto Coelho Newbie

            Guys you can try add the context parameter org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL to web.xml with the value true.

            And put the jar, api and imp int WEB-INF/lib.