title: Could not find backup for factory javax.faces.application.ApplicationFactory
body: <p>i am running my dynamic web application web application</p>
  
  <p>i am getting following error</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>16:42:14,111 SEVERE [javax.faces] (ServerService Thread Pool -- 123) Unable to obtain InjectionProvider from init time FacesContext. Does this container implement the Mojarra Injection SPI?
  16:42:14,112 SEVERE [javax.faces] (ServerService Thread Pool -- 123) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
  16:42:14,114 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 123) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./RGExtranet: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./RGExtranet: java.lang.RuntimeException: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   at java.lang.Thread.run(Thread.java:745)
   at org.jboss.threads.JBossThread.run(JBossThread.java:320)
  Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
   at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:236)
   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
   ... 6 more
  Caused by: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
   at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:555)
   at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283)
   at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:169)
   at org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:231)
   at javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:1488)
   at org.apache.myfaces.webapp.AbstractFacesInitializer._createFacesContext(AbstractFacesInitializer.java:529)
   at org.apache.myfaces.webapp.AbstractFacesInitializer.initStartupFacesContext(AbstractFacesInitializer.java:501)
   at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:115)
   at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
   at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:200)
   at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:171)
   at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
   at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
   at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:234)
   ... 8 more</code></pre>
  </div>
  </div>
  </p>
  
  <p>i have only my faces 2.2.11 api and impl jars in my class path i removed jsf api's from web-inf folder and i have tried this solution also like changing listener class in web.xml as follow :</p>
  
  <pre><code> &lt;listener&gt;
  &lt;listener-class&gt;org.apache.myfaces.webapp.StartupServletContextListener&lt;/listener-class&gt;
  </code></pre>
  
  <p></p>
  
  <p>to </p>
  
  <pre><code>&lt;listener&gt;
  &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt;
  </code></pre>
  
  <p></p>
  
  <p>but it is psrt of jsf jar</p>
  
  <p>i tried also jsf jars with above change but error still remains</p>
  
  <p>i tried all the solutions available but no one is usable in my case</p>