what jetty are u using ?

Jetty 6 has fixed this.

the listener is define inside the TLD, shipped with myfaces core.

-M

On 6/22/07, Henrik Larsson <[EMAIL PROTECTED]> wrote:
Hello,

I'm currently developing an application using osgi (knopflerfish),
jetty and myfaces. I have a jetty bundle with all code for the
presentation layer.

Included in the bundle jar are the jars for jetty, myfaces-api and myfaces-impl.

I have the following code to add a web application to jetty:

                WebAppContext context = new WebAppContext();
                context.setContextPath( "/" + name );
                context.setWar( path.getAbsolutePath() );
                server.addHandler( context );
                try
                {
                        context.start();
                }
                catch ( Exception e )
                {
                        e.printStackTrace();
                }

At this point the jetty server is successfully started and running,
but when running context.start(), I get the following exception:

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;
<listener>
  
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:96)
        at javax.faces.webapp.FacesServlet.init(FacesServlet.java:91)
        at 
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:442)
        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 
se.cfl.netvux.webserver.JettyServer.addWebApplication(JettyServer.java:101)


I suspect that it's a matter of my bundle not being able to locate the
myfaces-impl jar file. The jar file is included in the bundle jar and
it is in Bundle-Classpath of the manifest.

Any ideas what may be wrong?

/ Henrik



--
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

Reply via email to