Details
-
Bug
-
Resolution: Done
-
Major
-
14.0.1.Final
-
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).