It seems that Weld is using GlobalLenientObserverNotifier when destroying expired/ended conversations when the conversation context is deactivated. This notifier should not be used in this case because only observers accessible from the web archive should be notified. Moreover, it seems that two events with qualifier @Destroyed(ConversationScoped.class) are fired for the current conversation that ended in the current request. One with payload javax.servlet.http.HttpServletRequest and one with payload java.lang.String. The spec is clear that if the conversation context is associated with the current Servlet request javax.servlet.http.HttpServletRequest should be used (see https://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#conversation_context_ee). Currently, if you define an observer like this: @Observes @Destroyed(ConversationScoped.class) Object event it would be notified twice. I'll try to propose a fix for both of these issues. |