title: Websphere Exception: could not find Factory: javax.faces.context.FacesContextFactory
body: <p>The problem is <code>could not find Factory: javax.faces.context.FacesContextFactory</code>, but on Websphere application server.</p>
  
  <p>I have a web application which I ship with my own jsf impl, Mojarra 2.1.24, and expression language 2, but to do this I followed IBM guideline
  <a href="http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Fae%2Ftweb_jsf.html" rel="nofollow">Configuring JavaServer Faces implementation</a>. 
  As stated by IBM I created a shared folder where I put the following jar (which I removed from WEB-INF/lib):</p>
  
  <ul>
  <li>el-api.jar  </li>
  <li>el-impl.jar </li>
  <li>jsf-api.jar </li>
  <li>jsf-impl.jar </li>
  <li>jstl.jar </li>
  </ul>
  
  <p>Then I deployed the webapp and linked the shared lib to the webapp.</p>
  
  <p>The web.xml is the following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;web-app 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"
    version="3.0"&gt;                
      &lt;context-param&gt;
          &lt;param-name&gt;com.sun.faces.enableMissingResourceLibraryDetection&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.expressionFactory&lt;/param-name&gt;
          &lt;param-value&gt;com.sun.el.ExpressionFactoryImpl&lt;/param-value&gt;
      &lt;/context-param&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;org.ajax4jsf.handleViewExpiredOnClient&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;org.richfaces.CONTROL_SKINNING&lt;/param-name&gt;
          &lt;param-value&gt;enable&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;org.richfaces.skin&lt;/param-name&gt;
          &lt;param-value&gt;#{applicationBean.skin}&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;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;/faces/*&lt;/url-pattern&gt;
          &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
          &lt;url-pattern&gt;*.faces&lt;/url-pattern&gt;
          &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;   
      &lt;servlet&gt;
          &lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.richfaces.webapp.ResourceServlet&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;Resource Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/org.richfaces.resources/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;     
      &lt;session-config&gt;
          &lt;session-timeout&gt;30&lt;/session-timeout&gt;
      &lt;/session-config&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;ecss&lt;/extension&gt;
          &lt;mime-type&gt;text/css&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;xhtml&lt;/extension&gt;
          &lt;mime-type&gt;text/html&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>The application start produces the following exception:</p>
  
  <pre><code>Caused by: 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 com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:342)
  ... 26 more
  </code></pre>