Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-1921

<init-on-startup> in ejb-jar.xml doesn't suppress the EJB's @Startup annotation

    XMLWordPrintable

Details

    Description

      For a Singleton EJB defined as follows:

      @Singleton(name="MyInit")
      @Startup
      public class MyInit {

      @PostConstruct
      void init()

      { System.out.println("=========== INITIALIZING! ==========="); }

      }

      and for ejb-jar.xml fragment defined as follows:

      <session>
      <ejb-name>MyInit</ejb-name>
      <init-on-startup>false</init-on-startup>
      </session>

      The MyInit EJB is still initializing and you can still see the '======= INITIALIZING! =====' part in the logs.

      It seems that the <init-on-startup> element's value is not suppressing the @Startup annotation.

      Exemplary application: http://community.jboss.org/servlet/JiveServlet/download/628245-41501/StartupAS7.jar

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            PedroKowalski Piotr Nowicki (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: