1 Reply Latest reply on Jan 4, 2012 3:58 PM by aslak

    Arquillian and seam-faces: cannot setup listeners

    bitec

      Hi.

       

      I'm trying to launch embedded Glassfish 3.1 and "deploy" my web app there. It uses seam-faces dependency as though. I use the following script for this:

       

       

       @Deployment
          public static WebArchive createArchiveAndDeploy() {
              return ShrinkWrap
                  .create(WebArchive.class, "rstk.war")
                  .addPackages(true, "com/rstk/kasko/dao", "com/rstk/kasko/entity", "com/rstk/kasko/enumeration",
                      "com/rstk/kasko/exceptions", "com/rstk/kasko/storage", "com/rstk/kasko/qualifier",
                      "com/rstk/kasko/validation", "com/rstk/kasko/bean/calculator", "com/rstk/kasko/utils",
                      "com/rstk/kasko/auth")
                  .addAsManifestResource("arquillian/test-persistence.xml", "persistence.xml")
                  .addAsResource(new File(WEBAPP_SRC, "WEB-INF/spring/applicationContext.xml"))
                  .addAsResource(new File(WEBAPP_SRC, "WEB-INF/spring/applicationContext-security.xml"))
                  .addAsResource(new File(WEBAPP_SRC, "WEB-INF/spring/applicationContext-roles.xml"))
                  .addAsWebInfResource(new File(WEBAPP_SRC, "WEB-INF/beans.xml"))
                  .addAsWebInfResource(new File(WEBAPP_SRC, "WEB-INF/faces-config.xml"))
                  .setWebXML(new File(WEBAPP_SRC, "WEB-INF/web.xml"));
          }
      
      

       

      But get the following exception:

       

       

      ... 
      INFO: WELD-000900 SNAPSHOT
      04.01.2012 19:39:29 org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
      INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
      04.01.2012 19:39:30 org.jboss.seam.solder.core.VersionLoggerUtil logVersionInformation
      INFO: Seam Solder 3.0.0.Final (build id: 3.0.0.Final)
      04.01.2012 19:39:34 com.sun.faces.config.ConfigureListener contextInitialized
      INFO: Initializing Mojarra 2.1.0 (FCS 2.1.0-b11) for context '/rstk'
      04.01.2012 19:39:36 com.sun.faces.config.configprovider.BaseWebConfigResourceProvider getResources
      WARNING: JSF1067: Resource /WEB-INF/classes/META-INF/rstk-tag.taglib.xml specified by the javax.faces.CONFIG_FILES configuration option cannot be found.  The resource will be ignored.
      04.01.2012 21:24:04 com.sun.faces.config.ConfigManager initialize
      INFO: Unsanitized stacktrace from failed start...
      java.util.NoSuchElementException
                at com.google.common.collect.Iterators$1.next(Iterators.java:65)
                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:106)
                at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2129)
                at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2105)
                at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:300)
                at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:683)
                at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:683)
                at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:603)
                at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:369)
                at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4690)
      
      

       

      As I see in debug the bean of class org.jboss.seam.faces.event.SystemEventBridge is not initialized and cannot be recieved from BeanManager (getBeanManager().getBeans(clazz).iterator().next(); - getBeans(..) returns empty array).

       

      Any thoughts?

       

      Thanks, Anton.