title: JSF 2.0 app under Tomcat 6: "No Factories configured."
body: <p>I am trying to run a JSF 2.0 webapp using Apache MyFaces 2.1.7 on a Tomcat 6 webserver. The App uses Tomahawk 1.1.11 and expression language 2.2 (el-impl-2.2.jar). For that purpose I've put the myfaces-api and myfaces-impl into Tomcats lib folder and exchanged Tomcats el-api.jar for the 2.2 variant.</p>
  
  <p>When I call the first page of the app I always get the error:</p>
  
  <pre><code>java.lang.IllegalStateException: No Factories configured for this Application. This 
  happens if the faces-initialization does not work at all - make sure that you properly 
  include all configuration settings necessary for a basic faces application and that all 
  the necessary libs are included. Also check the logging output of your web application 
  and your container for any exceptions!
  If you did that and find nothing, the mistake might be due to the fact that you use 
  some special web-containers which do not support registering context-listeners via TLD 
  files and a context listener is not setup in your web.xml.
  A typical config looks like this;
  &lt;listener&gt;
   &lt;listener-class&gt;org.apache.myfaces.webapp.StartupServletContextListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  javax.faces.FactoryFinder._getFactory(FactoryFinder.java:286)
  javax.faces.FactoryFinder.getFactory(FactoryFinder.java:206)
  javax.faces.webapp.FacesServlet.init(FacesServlet.java:116)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  java.lang.Thread.run(Thread.java:679)
  </code></pre>
  
  <p>I definitely have the xml snippet mentioned in my <code>web.xml</code>. I tried to debug into the code and found that <code>registeredFactoryNames</code> on line 267 of <code>javax.faces.FactoryFinder</code> is empty which causes the error. I however do not understand why this is the case. What should be in there and how do I get it there?</p>
  
  <p>The funny thing is that the webapp runs perfectly using embedded jetty 8. So it must be some dependency issue.</p>
  
  <p>Hope someone with more insight into all of this can help me here.</p>