4 Replies Latest reply on May 16, 2012 1:11 AM by jshepher

    Using Mojarra 2.0.4 with JBoss AS 7.0.2.Final

    lucaster

      JBoss AS 7.0.2 comes with Mojarra 2.1.3, but I need to user Mojarra 2.0.4 in my project, because of this bug.

       

      Here is what I tried:

       

      1.  create jboss-deployment-structure.xml in WEB-INF

       

                <?xml version="1.0" encoding="UTF-8"?>
                <jboss-deployment-structure>
                      <deployment>
                          <exclusions>
                                <module name="javax.faces.api" slot="main"/>
                               <module name="com.sun.jsf-impl" slot="main"/>
                           </exclusions>
                           <dependencies>
                                <module name="javax.faces.api" slot="2.0.4"/>
                                <module name="com.sun.jsf-impl" slot="2.0.4"/>
                           </dependencies>
                      </deployment>
                 </jboss-deployment-structure>

       

      2.  In JBOSS_702_HOME/modules/com/sun/jsf-impl create folder 2.0.4

      3.  Copy files from JBOSS_701_HOME/modules/com/sun/jsf-impl/main to JBOSS_702_HOME/modules/com/sun/jsf-impl/2.0.4

      4.  In JBOSS_702_HOME/modules/javax/faces/api create folder 2.0.4

      5.  Copy files from JBOSS_701_HOME/modules/javax/faces/api/main to JBOSS_702_HOME/modules/javax/faces/api/2.0.4

       

      After following these steps, however, the deployment of my project fails with the folllowing exception:

       

      Caused by: org.jboss.modules.ModuleLoadException: Error loading module from JBOSS_702_HOME/modules/javax/faces/api/2.0.4/module.xml


      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[25,61]
      Message: Invalid/mismatched module name (expected javax.faces.api:2.0.4)

       

      So, I changed the name in module.xml from "javax.faces.api" to "javax.faces.api:2.0.4"

       

      However, deployment keeps failing with that same exception!

       

      Can someone help me sort this out? Many thanks!

        • 1. Re: Using Mojarra 2.0.4 with JBoss AS 7.0.2.Final
          bwilly

          If you get an answer to this, please post it. I am encountering the same problem. Thanks.

          • 2. Re: Using Mojarra 2.0.4 with JBoss AS 7.0.2.Final
            bwilly

            A partial solution:

             

            I followed the steps above but then took it a bit further by:

             

            1) get appropriate imp and api jars for 2.0.4 version and place them in the newly created 2.0.4 dirs.

            2) also modify all references to versions and slots found in the module.xml of the api and impl. I based mine on referencing the 1.2 impl and ap that come w/ JBoss AS 7.

             

            This worked to the point that my app almost deployed, but now I am stuck with the following exception:

             

            16:10:20,326 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory

             

            If you get further, please let me know.

            • 3. Re: Using Mojarra 2.0.4 with JBoss AS 7.0.2.Final
              nickarls

              If you are OK with downgrading on the AS, the modules needed are javax.faces.api (main) and com.sun.jsf-impl (main)

              • 4. Re: Using Mojarra 2.0.4 with JBoss AS 7.0.2.Final
                jshepher

                In the modules/javax/faces/api/2.0.4 folder, If you had defined your module.xml like this:

                 

                <module xmlns="urn:jboss:module:1.1" name="javax.faces.api">

                 

                You need to change it to this:

                 

                <module xmlns="urn:jboss:module:1.1" name="javax.faces.api" slot="2.0.4"/>