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

EE naming context not set when @Initialized(ApplicationScoped.class) event is fired in some cases

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 15.0.0.Final
    • 14.0.1.Final
    • CDI / Weld
    • None

    Description

      Since this commit (which fixed WFLY-9732), the EE naming context is not set up properly when WeldBootstrap.endInitialization() is called. This is because the naming context is set up by the SetupAction executed in WeldStartService. (WeldBootstrap.endInitialization() used to be invoked from WeldStartService as well, but the commit linked above moved the invocation to a separate WeldStartCompletionService.)

      That is a problem because endInitialization() is where the @Initialized(ApplicationScoped.class) event is fired from (in some cases). If there's a bean that's being eagerly-initialized by listening for this event and the bean also requires the EE naming context (e.g. for injecting @Resource(lookup = "java:comp/DefaultManagedThreadFactory")), deployment now fails (because the resource injection fails).

      I can see this problem in Thorntail, because the pattern described above is used in SmallRye Fault Tolerance (see HystrixInitializer and DefaultHystrixConcurrencyStrategy).

      Attachments

        Activity

          People

            lthon@redhat.com Ladislav Thon
            lthon@redhat.com Ladislav Thon
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: