Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-5097

@Startup @Singleton Beans Constructed Multiple Times

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 20.0.0.Final
    • 9.0.1.Final
    • EJB
    • None
    • Hide

      1) Create a @Singleton @Startup @ApplicationScoped bean
      2) Add logger events to track transit thru constructor/postconstructors methods
      2) Inject or use the bean

      Show
      1) Create a @Singleton @Startup @ApplicationScoped bean 2) Add logger events to track transit thru constructor/postconstructors methods 2) Inject or use the bean

      When using @Startup and/or @Singleton to start a Bean on server startup, everytime a method is accessed or the bean is injected with @EJB, both Constructor and @Postconstruct are executed.

      This happens multiple times, each time any component uses the Singleton bean.

      This seems similar to an issue reported for JBOSS AS 7.x (see forum link reference below)

            psotirop@redhat.com Panagiotis Sotiropoulos
            dcrudo_jira Davide Crudo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: