Uploaded image for project: 'Seam Faces'
  1. Seam Faces
  2. SEAMFACES-148

Certain bean scopes prevent application to start on tomcat (either 6 or 7)

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.0.0.Final
    • Fix Version/s: None
    • Component/s: CDI Integration
    • Labels:
      None
    • Environment:

      tomcat 6 or 7

      Description

      When deploying the simplest application with cdi+seamfaces to Tomcat 6 or 7 certain scopes prevents application to start succesfully.
      Scopes that work are @RequestScoped and @ApplicationScoped, however other scopes (@SessionScoped,@ViewScoped,@RenderScoped,@ConversationScoped) break the application with the following exception:

      org.jboss.seam.solder.beanManager.BeanManagerUnavailableException: Failed to locate BeanManager using any of these providers: org.jboss.seam.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.seam.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
      at org.jboss.seam.solder.beanManager.BeanManagerLocator.getBeanManager(BeanManagerLocator.java:91)
      at org.jboss.seam.solder.beanManager.BeanManagerAware.getBeanManager(BeanManagerAware.java:56)
      at org.jboss.seam.faces.event.AbstractListener.getListeners(AbstractListener.java:25)
      at org.jboss.seam.faces.event.DelegatingSystemEventListener.getEventListeners(DelegatingSystemEventListener.java:43)
      at org.jboss.seam.faces.event.DelegatingSystemEventListener.processEvent(DelegatingSystemEventListener.java:34)
      at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)
      at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2040)
      at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2016)
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:298)
      at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:330)
      at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:598)
      at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:341)
      at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:220)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Apr 20, 2011 10:04:24 AM org.apache.catalina.core.StandardContext listenerStart
      SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
      com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Failed to locate BeanManager using any of these providers: org.jboss.seam.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.seam.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
      at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:351)
      at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:220)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: org.jboss.seam.solder.beanManager.BeanManagerUnavailableException: Failed to locate BeanManager using any of these providers: org.jboss.seam.solder.beanManager.DefaultJndiBeanManagerProvider(11), org.jboss.seam.solder.beanManager.ServletContainerJndiBeanManagerProvider(10)
      at org.jboss.seam.solder.beanManager.BeanManagerLocator.getBeanManager(BeanManagerLocator.java:91)
      at org.jboss.seam.solder.beanManager.BeanManagerAware.getBeanManager(BeanManagerAware.java:56)
      at org.jboss.seam.faces.event.AbstractListener.getListeners(AbstractListener.java:25)
      at org.jboss.seam.faces.event.DelegatingSystemEventListener.getEventListeners(DelegatingSystemEventListener.java:43)
      at org.jboss.seam.faces.event.DelegatingSystemEventListener.processEvent(DelegatingSystemEventListener.java:34)
      at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)
      at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2040)
      at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2016)
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:298)
      at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:330)
      at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:598)
      at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:341)
      ... 16 more
      Apr 20, 2011 10:04:24 AM org.apache.catalina.core.StandardContext start
      SEVERE: Error listenerStart
      Apr 20, 2011 10:04:24 AM org.apache.catalina.core.StandardContext start
      SEVERE: Context [/facesexample] startup failed due to previous errors
      Apr 20, 2011 10:04:24 AM com.sun.faces.config.ConfigureListener contextDestroyed
      SEVERE: Unexpected exception when attempting to tear down the Mojarra runtime
      java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
      at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:800)
      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:302)
      at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:104)
      at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:312)
      at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4244)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4879)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4749)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
      at org.apache.catalina.core.StandardService.start(StandardService.java:525)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
      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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

      Simplest way to reproduce it is to take the weld archetype for servlet:
      mvn archetype:generate -DarchetypeArtifactId=jboss-jsf-weld-servlet-webapp -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.1.Beta1 -DarchetypeRepository=central

      And add dependancies for seam-solder and seamfaces module on the classpath.
      Than depending on the scope of the HelloWorldBean bean (that is included as a part of the application) the application will start or not.
      By default the HelloWorldBean is annotated as @Model. Because of that the application manages to start. But if you cnahe its annotations to @Named@SessionScoped for example, the applicaiton will fail on startup.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                brvuga brvno brvnic
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: