title: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory
body: <p>I'm getting the java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. when I deploy my webapp as a .war.  Does anyone have an idea where to begin looking for the root cause of this problem? The application runs as expected in the Eclipse IDE, but when exported as a war for deploying on the publicly available stand-alone TomEE environment, it fails.</p>
  
  <p>Many thanks.</p>
  
  <p>My configuration:
  Apache TomEE - WebProfile 1.6.0.2
  JSF 2.2.7 (com.sun.faces)(Mojarra lib 2.2.0) &lt;-- This may be a problem? But why does the app run in the Eclipse environment but not the stand-alone TomEE?</p>
  
  <p>Maven 4.0.0</p>
  
  <pre><code>java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. 
      javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1004)
      javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316)
      javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
      org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
      java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      java.lang.Thread.run(Thread.java:744)
  </code></pre>
  
  <p>The web.xml:</p>
  
  <pre><code>&lt;web-app 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns="http://java.sun.com/xml/ns/javaee" 
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
      id="WebApp_ID" 
      version="3.0"&gt;
    &lt;display-name&gt;ProjName&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;login.xhtml&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;listener&gt;
      &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt;
    &lt;/listener&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
      &lt;param-value&gt;Development&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.FACELETS_SKIP_COMMENTS&lt;/param-name&gt;
      &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/context-param&gt;
     &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;com.sun.faces.forceLoadConfiguration&lt;/param-name&gt;
      &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/context-param&gt;
  
    &lt;context-param&gt;
      &lt;description&gt;State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2&lt;/description&gt;
      &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
      &lt;param-value&gt;client&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;javax.servlet.jsp.jstl.fmt.localizationContext&lt;/param-name&gt;
      &lt;param-value&gt;resources.application&lt;/param-value&gt;
    &lt;/context-param&gt;
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.faces&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>The jars that are exported in the .war WEB-INF/lib directory:</p>
  
  <pre><code>WEB-INF/lib/javax.faces.jar
  WEB-INF/lib/javax.faces-api-2.2.jar
  WEB-INF/lib/jsf-api-2.2.7.jar
  WEB-INF/lib/jsf-impl-2.2.7.jar
  WEB-INF/lib/poi-3.10-FINAL.jar
  WEB-INF/lib/commons-codec-1.5.jar
  WEB-INF/lib/poi-ooxml-3.10-FINAL.jar
  WEB-INF/lib/poi-ooxml-schemas-3.10-FINAL.jar
  WEB-INF/lib/xmlbeans-2.3.0.jar
  WEB-INF/lib/stax-api-1.0.1.jar
  WEB-INF/lib/dom4j-1.6.1.jar
  WEB-INF/lib/xml-apis-1.0.b2.jar
  WEB-INF/lib/cxf-bundle-jaxrs-2.7.11.jar
  WEB-INF/lib/woodstox-core-asl-4.2.1.jar
  WEB-INF/lib/stax2-api-3.1.4.jar
  WEB-INF/lib/xmlschema-core-2.1.0.jar
  WEB-INF/lib/geronimo-javamail_1.4_spec-1.7.1.jar
  WEB-INF/lib/wsdl4j-1.6.3.jar
  WEB-INF/lib/jaxb-impl-2.1.13.jar
  WEB-INF/lib/jetty-server-8.1.14.v20131031.jar
  WEB-INF/lib/jetty-continuation-8.1.14.v20131031.jar
  WEB-INF/lib/jetty-http-8.1.14.v20131031.jar
  WEB-INF/lib/jetty-io-8.1.14.v20131031.jar
  WEB-INF/lib/jetty-util-8.1.14.v20131031.jar
  WEB-INF/lib/jetty-security-8.1.14.v20131031.jar
  WEB-INF/lib/slf4j-api-1.7.6.jar
  WEB-INF/lib/geronimo-servlet_3.0_spec-1.0.jar
  WEB-INF/lib/javax.ws.rs-api-2.0-m10.jar
  WEB-INF/lib/postgresql-9.3-1101-jdbc41.jar
  WEB-INF/lib/commons-httpclient-3.1.jar
  WEB-INF/lib/commons-logging-1.0.4.jar
  WEB-INF/lib/hamcrest-all-1.3.jar
  WEB-INF/lib/junit-4.11.jar
  WEB-INF/lib/hamcrest-core-1.3.jar
  WEB-INF/lib/httpclient-4.3.3.jar
  WEB-INF/lib/httpcore-4.3.2.jar
  WEB-INF/lib/commons-dbcp2-2.0.jar
  WEB-INF/lib/commons-pool2-2.2.jar
  WEB-INF/lib/mockito-core-1.9.5.jar
  WEB-INF/lib/objenesis-1.0.jar
  </code></pre>