So I've created an automated test for this, available on this branch. The problem seems to be manifesting only when Jandex is in play - in other words, it will show itself on WFLY (sometimes crashing, sometimes passing based on random order) but will work just fine in Weld SE (without manually enforcing Jandex OFC) or embedded container. The test reflects this by the ability to run with -Dincontainer on WFLY and without the parameter in embedded container. We should look into implementing ordering for when Jandex is in play. The relevant parts are (likely) - org.jboss.weld.bootstrap.events.ContainerLifecycleEvents.fireProcessAnnotatedType(BeanManagerImpl, SlimAnnotatedTypeContext<T>) which handles the even firing and either fires it via fast events (unsorted) or delegates to ObserverNotifier which then has it sorted. |