Marko Lukša commented on Bug WELD-1517

In WildFly:
1. WeldInitialListener.contextDestroyed() -> @Observes @Destroyed(ApplicationScoped.class)
2. as.weld.WeldBootstrapService.stop() -> WeldBootstrap.shutdown() -> ApplicationContext.destroy() -> disposer method

In weld-servlet:
1. WeldBootstrap.shutdown() -> ApplicationContext.destroy() -> disposer method
2. WeldInitialListener.contextDestroyed() -> @Observes @Destroyed(ApplicationScoped.class) is NOT called, because observer methods are not resolved any more

WeldBootstrap.shutdown() first destroys the ApplicationContext (and invokes disposer methods of application scoped beans) and then clears the container, which means observer methods cannot be resolved any more. Therefore, firing @Destroyed(ApplicationScoped.class) after that will not reach any observers. Not sure why we're not firing the event during ApplicationContext.destroy().

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira