dev@javaserverfaces.java.net

error using jsf 12_03 in tomcat / jetty

From: Matthias Wessendorf <matzew_at_apache.org>
Date: Wed, 10 Jan 2007 16:11:48 +0100

Tomcat 6:

10.01.2007 15:59:36 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Exception sending context initialized event to listener
instance of class com.sun.faces.config.GlassFishConfigureListener
java.lang.IllegalStateException: Application was not properly
initialized at startup, could not find Factory:
javax.faces.application.ApplicationFactory
        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:263)
        at com.sun.faces.util.MessageFactory.getApplication(MessageFactory.java:200)
        at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:97)
        at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:84)
        at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:266)
        at com.sun.faces.config.ConfigureListener.digester(ConfigureListener.java:1486)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:450)
        at com.sun.faces.config.GlassFishConfigureListener.contextInitialized(GlassFishConfigureListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:451)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        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:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
10.01.2007 15:59:36 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Exception sending context initialized event to listener
instance of class com.sun.faces.config.ConfigureListener
java.lang.ClassCastException: com.sun.faces.config.WebConfiguration
        at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:151)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:279)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:451)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        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:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
---------------------------------------------------------------------------------------------------------------------------------------------------------

Jetty:

java.lang.NullPointerException
        at com.sun.faces.application.ApplicationAssociate.getInstance(ApplicationAssociate.java:171)
        at com.sun.faces.application.WebappLifecycleListener.handleAttributeEvent(WebappLifecycleListener.java:221)
        at com.sun.faces.application.WebappLifecycleListener.attributeReplaced(WebappLifecycleListener.java:211)
        at org.mortbay.jetty.handler.ContextHandler$SContext.setAttribute(ContextHandler.java:1364)
        at com.sun.faces.config.ConfigureListener$ApplicationMap.put(ConfigureListener.java:1885)
        at com.sun.faces.renderkit.RenderKitUtils.loadSunJsfJs(RenderKitUtils.java:1076)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:468)
        at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:505)
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1174)
        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:475)
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:433)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
        at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:156)
        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:156)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:119)
        at org.mortbay.jetty.Server.doStart(Server.java:210)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
        at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:134)




looks like the "servletContext" property is not set with "contextInitialized"

when handleAttributeEvent(...) does:
ApplicationAssociate associate =
              ApplicationAssociate.getInstance(servletContext);









-M







-- 
Matthias Wessendorf
http://tinyurl.com/fmywh
further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com