2 Replies Latest reply on Dec 5, 2008 9:11 AM by Robert R

    Maven/Jetty Test Error: failed Faces Servlet

    Robert R Newbie

      I am having problems running the tests in JSFUnit out-of-the-box. I am now seeing the same error as in my own test application.

      For the JSFUnit test application: jboss-jsfunit-examples-hellojsf, I try running the following:

      mvn install -P test

      And see the following error:

      [INFO] [beddedLocalContainer] Jetty 6.x Embedded starting...
      2008-12-04 11:06:22.781::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
      2008-12-04 11:06:22.828::INFO: jetty-6.1.1rc1
      2008-12-04 11:06:23.016::INFO: Extract jar:file:/C:/pearson/tools/jsfunit/jboss
      -jsfunit-examples/jboss-jsfunit-examples-hellojsf/jboss-jsfunit-examples-hellojs
      f-jsfunit/target/jboss-jsfunit-examples-hellojsf-jsfunit.war!/ to C:\DOCUME~1\ur
      aporo\LOCALS~1\Temp\Jetty_0_0_0_0_8080_jboss-jsfunit-examples-hellojsf-jsfunit.w
      ar__jboss-jsfunit-examples-hellojsf-jsfunit__xxbyav\webapp
      2008-12-04 11:06:24.031::WARN: Unknown realm: Authenticated
      2008-12-04 11:06:25.109::WARN: failed Faces Servlet
      javax.servlet.UnavailableException: javax.faces.webapp.FacesServlet
      at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:78)
      at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:23
      5)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
      40)
      at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.ja
      va:593)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.jav
      a:1191)
      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:
      481)
      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:434
      )
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
      40)
      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection
      .java:147)
      at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHan
      dlerCollection.java:120)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
      40)
      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection
      .java:147)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
      40)
      at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:
      117)
      at org.mortbay.jetty.Server.doStart(Server.java:210)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
      40)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.cargo.container.jetty.internal.JettyExecutorThread.run(J
      ettyExecutorThread.java:68)


      In my own project, I have set up a separate JSFUnit maven module as directed. I see the same problem. I tried adding the following dependencies to my pom.xml:


      javax.faces
      jsf-api
      1.2
      runtime



      javax.servlet
      servlet-api
      2.5
      runtime


      This ends up switching my error to the following:

      2008-12-04 10:56:48.359::WARN: failed FacesServlet
      javax.servlet.ServletException: javax.servlet.ServletException: org.jboss.portletbridge.context.FacesContextFactoryImpl
      at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:446)
      at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:259)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:593)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1191)
      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:481)
      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:434)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
      at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:120)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
      at org.mortbay.jetty.Server.doStart(Server.java:210)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.cargo.container.jetty.internal.JettyExecutorThread.run(JettyExecutorThread.java:68)
      Caused by: javax.servlet.ServletException: org.jboss.portletbridge.context.FacesContextFactoryImpl
      at javax.faces.webapp.FacesServlet.init(FacesServlet.java:150)
      at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:442)
      ... 21 more
      Caused by: java.lang.InstantiationException: org.jboss.portletbridge.context.FacesContextFactoryImpl
      at java.lang.Class.newInstance0(Class.java:340)
      at java.lang.Class.newInstance(Class.java:308)
      at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:585)
      at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:452)
      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:256)
      at javax.faces.webapp.FacesServlet.init(FacesServlet.java:142)
      ... 22 more

      As you can see from the exceptions, I am trying to use JSF with the JBoss Portlet Bridge.

      Any thoughts on these issues?

      Thank you very much for any help.

      Robert