0 Replies Latest reply on Oct 14, 2011 9:15 AM by visualmatrix

    MyFaces 1.2.9 on JBossAS 6.1.0

    visualmatrix Newbie

      Hello,

       

      I am trying to deploy an EAR using MyFaces 1.2.9 on JBossAS 6 [6.1.0.Final "Neo"]. JBoss comes with Mojarra-1.2, MyFaces-2.0, Mojarra-2.0, but no MyFaces 1.2 is included! So I looked in the JSF-Guide (http://docs.jboss.org/jbossas/6/JSF_Guide/en-US/html/jsf.deployer.config.html#bundling.jsf.with.war) and found two possible solutions:

      1. Bundling JSF Inside Your WAR (Chapter 3.6)
      2. Adding new JSF Configuration (Chapter 3.7)

       

      I decided to use No. 1 and added following lines to my web.xml:

       

      <context-param>
            <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
            <param-value>true</param-value>
      </context-param>

       

      But when I am deploying my EAR to JBoss I get the following error:

       

      2011-10-14 14:40:27,838 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp]] (HDScanner) StandardWrapper.Throwable: java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!

      If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.

      A typical config looks like this;

      <listener>

        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>

      </listener>

       

          at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:106) [:1.2.10]

          at javax.faces.webapp.FacesServlet.init(FacesServlet.java:137) [:1.2.10]

          at org.apache.myfaces.webapp.MyFacesServlet.init(MyFacesServlet.java:113) [:1.2.10]

      ...

       

       

      This is from my web.xml:

       

        <!-- Tell JBoss to use the bundled MyFaces JSF Implementation -->

        <context-param>

          <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>

          <param-value>true</param-value>

        </context-param>

        

        <!-- Listener, to allow serving MyFaces apps -->

        <listener>

          <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>

        </listener>

       

        <!-- Faces Servlet -->

        <servlet>

          <servlet-name>Faces Servlet</servlet-name>

          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

          <load-on-startup>1</load-on-startup>

        </servlet>

       

        <!-- Faces Servlet Mapping -->

        <servlet-mapping>

          <servlet-name>Faces Servlet</servlet-name>

          <url-pattern>*.jsf</url-pattern>

        </servlet-mapping>

       

       

       

       

      This is from my Maven pom.xml:

       

          <dependency>

            <groupId>org.apache.myfaces.core</groupId>

            <artifactId>myfaces-api</artifactId>

            <version>1.2.10</version>

            <scope>compile</scope>

          </dependency>

       

          <dependency>

            <groupId>org.apache.myfaces.core</groupId>

            <artifactId>myfaces-impl</artifactId>

            <version>1.2.10</version>

            <scope>compile</scope>

          </dependency>

       

          <dependency>

            <groupId>org.apache.myfaces.tomahawk</groupId>

            <artifactId>tomahawk</artifactId>

            <version>1.1.8</version>

            <scope>compile</scope>

          </dependency>

       

          <dependency>

            <groupId>com.sun.facelets</groupId>

            <artifactId>jsf-facelets</artifactId>

            <version>1.1.15</version>

            <scope>compile</scope>

          </dependency>

       

       

      Please help me! :-)