0 Replies Latest reply on Apr 3, 2015 7:08 AM by BhaskarReddy Allu

    class org.apache.myfaces.webapp.StartupServletContextListener: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.

    BhaskarReddy Allu Newbie

      Hi,I am trying to implement Maven JSF 2.0+Myfaces poc in JBose EAP environment,facing below issue while deploying war.

       

        Server Iog : :34,483 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/AdminUI]] (ServerService Thread Pool -- 227) JBWEB000287: Exception sending context initialized event to listene

      tance of class org.apache.myfaces.webapp.StartupServletContextListener: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.

         at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]

         at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]

         at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:137) [myfaces-impl-2.1.1.jar:2.1.1]

         at org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:186) [myfaces-impl-2.1.1.jar:2.1.1]

       

        I am using below dependency jars:

      ----------------------------------------------------------------------------------------------------

        <dependency>

        <groupId>javax.faces</groupId>

        <artifactId>jsf-api</artifactId>

        <version>2.0</version>

        <dependency>

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

        <artifactId>myfaces-api</artifactId>

        <version>2.1.1</version>

      </dependency>

          <dependency>

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

        <artifactId>myfaces-impl</artifactId>

        <version>2.1.1</version>

      </dependency>

      <dependency>

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

        <artifactId>tomahawk20</artifactId>

        <version>1.1.14</version>

      </dependency>

      ----------------------------------------------------------------------------

      web.xml file

      ----------------------------------------------------------------------------

      <?xml version="1.0"?>

      <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

      <display-name>SampleJSF</display-name>

       

      <display-name>MyFaces Test Project</display-name>

      <servlet>

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

        <servlet-class><!--org.apache.myfaces.webapp.MyFacesServlet-->javax.faces.webapp.FacesServlet</servlet-class>

      </servlet>

      <servlet-mapping>

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

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

      </servlet-mapping>

      <servlet-mapping>

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

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

      </servlet-mapping>

      <servlet-mapping>

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

        <url-pattern>/faces/*</url-pattern>

      </servlet-mapping>

       

      <context-param>

          <param-name>org.apache.myfaces.SOME_USEFUL_PARAM</param-name>

          <param-value>someValue</param-value>

      </context-param>

       

      <filter>

        <filter-name>MyFacesExtensionsFilter</filter-name>

        <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>

      </filter>

       

      <filter-mapping>

        <filter-name>MyFacesExtensionsFilter</filter-name>

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

      </filter-mapping>

       

      <filter-mapping>

        <filter-name>MyFacesExtensionsFilter</filter-name>

        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>

      </filter-mapping>

       

      <filter-mapping>

          <filter-name>MyFacesExtensionsFilter</filter-name>

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

      </filter-mapping>

       

      <listener>

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

      </listener>

      </web-app>

      ----------------------------------------------------------------------------