title: could not find Factory: javax.faces.context.FacesContextFactory
body: <p>I notice that when trying to setup my JSF 2 webapp running on jetty, i have this error :</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: Application was not properly
    initialized at startup, could not find Factory:
    javax.faces.context.FacesContextFactory</p>
  </blockquote>
  
  <p>which is easily solved by adding this to my web.xml</p>
  
  <pre><code>&lt;listener&gt;
      &lt;listener-class&gt;
          com.sun.faces.config.ConfigureListener
      &lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>I've tried searching for a detailed explanation but in futile ..</p>
  
  <p>jetty-maven-plugin:8.0.3.v20111011:run + jdk 7 + eclipse indigo</p>
  
  <p>And here's my maven dependency :</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish&lt;/groupId&gt;
          &lt;artifactId&gt;javax.faces&lt;/artifactId&gt;
          &lt;version&gt;2.1.3&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>Here's my 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_2_5.xsd"
      version="2.5"&gt;
      &lt;display-name&gt;Basic Setup Web Application&lt;/display-name&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;/servlet-mapping&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;faces/index.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;/web-app&gt;
  </code></pre>
  
  <p>and here's the output of the jetty plugin :</p>
  
  <pre><code>[INFO] &lt;&lt;&lt; jetty-maven-plugin:8.0.3.v20111011:run (default-cli) @ BasicSetup &lt;&lt;&lt;
  [INFO] 
  [INFO] --- jetty-maven-plugin:8.0.3.v20111011:run (default-cli) @ BasicSetup ---
  [INFO] Configuring Jetty for project: BasicSetup Maven Webapp
  [INFO] webAppSourceDirectory C:\Users\albert\workspace\BasicSetup\src\main\webapp does not exist. Defaulting to C:\Users\albert\workspace\BasicSetup\src\main\webapp
  [INFO] Reload Mechanic: automatic
  [INFO] Classes = C:\Users\albert\workspace\BasicSetup\target\classes
  [INFO] Context path = /basicSetup
  [INFO] Tmp directory = C:\Users\albert\workspace\BasicSetup\target\tmp
  [INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
  [INFO] Web overrides =  none
  [INFO] web.xml file = file:/C:/Users/albert/workspace/BasicSetup/src/main/webapp/WEB-INF/web.xml
  [INFO] Webapp directory = C:\Users\albert\workspace\BasicSetup\src\main\webapp
  2011-10-25 14:24:51.091:INFO:oejs.Server:jetty-8.0.3.v20111011
  2011-10-25 14:24:51.334:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
  2011-10-25 14:24:52.108:INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/basicSetup,[file:/C:/Users/albert/workspace/BasicSetup/src/main/webapp/, jar:file:/C:/Users/albert/.m2/repository/org/glassfish/javax.faces/2.1.3/javax.faces-2.1.3.jar!/META-INF/resources/]},file:/C:/Users/albert/workspace/BasicSetup/src/main/webapp/
  2011-10-25 14:24:52.108:INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/basicSetup,[file:/C:/Users/albert/workspace/BasicSetup/src/main/webapp/, jar:file:/C:/Users/albert/.m2/repository/org/glassfish/javax.faces/2.1.3/javax.faces-2.1.3.jar!/META-INF/resources/]},file:/C:/Users/albert/workspace/BasicSetup/src/main/webapp/
  2011-10-25 14:24:52.108:INFO:oejsh.ContextHandler:started o.m.j.p.JettyWebAppContext{/basicSetup,[file:/C:/Users/albert/workspace/BasicSetup/src/main/webapp/, jar:file:/C:/Users/albert/.m2/repository/org/glassfish/javax.faces/2.1.3/javax.faces-2.1.3.jar!/META-INF/resources/]},file:/C:/Users/albert/workspace/BasicSetup/src/main/webapp/
  2011-10-25 14:24:52.149:WARN:/basicSetup:unavailable
  java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
      at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:967)
      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316)
      at javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
      at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:456)
      at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:276)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:779)
      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:255)
      at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1212)
      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:610)
      at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:453)
      at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:256)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:89)
      at org.eclipse.jetty.server.Server.doStart(Server.java:262)
      at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)
      at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
      at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:514)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  [INFO] Started Jetty Server
  2011-10-25 14:24:52.165:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080 STARTING
  [INFO] Starting scanner at interval of 10 seconds.
  </code></pre>
  
  <p>Any thoughts ?</p>