5 Replies Latest reply on Feb 26, 2014 6:30 AM by daniell

    Event with qualifier @Initialized not fired if no webapp is deployed

    daniell

      I'm using Wildfly 8.0.0.Final to run my deployed application which is packaged in an EAR. At application-startup I want to do some initialization stuff. In one of my JARs (containing POJOs only) there is a bean containing a method like this:

       

      public class ApplicationInitialization
      {
          public void postConstruct(@Observes @Initialized(ApplicationScoped.class) Object o)
          {
              doInitialize();
          }
      }
      
      
      

       

      This works fine (i.e. the method is invoked at startup) if there is a WAR inside the EAR containing a small webapp. But if the WAR is missing and only JARs containing EJBs and POJOs are inside the EAR, this method is not called any more.

      I think the application-scope is active since I can use RMI to call EJBs which obtain other EJBs using the BeanManager and inject some request-scoped CDI-beans.