title: weblogic java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
body: <p>I have an application in java faces that work properly with Tomcat 7 with the follow web.xml.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 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;spfilesharing&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.xhtml&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;GetIAMToken&lt;/servlet-name&gt;
          &lt;servlet-class&gt;pt.ptinovacao.personal.spfilesharing.authentication.GetIAMToken&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;GetIAMToken&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/getIAMToken&lt;/url-pattern&gt;
      &lt;/servlet-mapping&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;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&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;
      &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;listener&gt;
          &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
          &lt;filter-class&gt;org.primefaces.webapp.filter.FileUploadFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;/filter-mapping&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;primefaces.THEME&lt;/param-name&gt;
          &lt;param-value&gt;bootstrap&lt;/param-value&gt;
      &lt;/context-param&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>To deploy the aplication in weblogic i am using a ear project with the follow weblogic-application.xml.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;weblogic-application xmlns="http://xmlns.oracle.com/weblogic/weblogic-application" 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/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.0/weblogic-application.xsd" &gt;
      &lt;prefer-application-packages&gt;
          &lt;package-name&gt;org.opensaml.*&lt;/package-name&gt;
          &lt;package-name&gt;org.slf4j.*&lt;/package-name&gt;
          &lt;package-name&gt;javax.faces.*&lt;/package-name&gt; 
          &lt;package-name&gt;com.sun.faces.*&lt;/package-name&gt; 
          &lt;package-name&gt;org.apache.myfaces.*&lt;/package-name&gt; 
      &lt;/prefer-application-packages&gt; 
  
      &lt;prefer-application-resources&gt; 
          &lt;resource-name&gt;javax.faces.*&lt;/resource-name&gt; 
          &lt;resource-name&gt;com.sun.faces.*&lt;/resource-name&gt; 
  
          &lt;resource-name&gt;META-INF/services/javax.servlet.ServletContainerInitializer&lt;/resource-name&gt;
      &lt;/prefer-application-resources&gt;
  
  &lt;/weblogic-application&gt;
  </code></pre>
  
  <p>When I run it in weblogic I'm getting the following error:</p>
  
  <pre><code>java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. 
      at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010)
      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342)
      at javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
      at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
      at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:250)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94)
      at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82)
      at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
      at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:60)
      at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:34)
      at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:624)
      at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:565)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:281)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
      at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3288)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3254)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2163)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2089)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2074)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1513)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
  </code></pre>
  
  <p>Does anyone know how to fix it?</p>