events must not get broadcasted to beans which have no active Context
---------------------------------------------------------------------

                 Key: OWB-337
                 URL: https://issues.apache.org/jira/browse/OWB-337
             Project: OpenWebBeans
          Issue Type: Bug
    Affects Versions: M4
            Reporter: Mark Struberg
            Assignee: Mark Struberg
            Priority: Minor
             Fix For: 1.0.0


If someone fires an Event, we currently deliver it to all contextual instances 
of beans which are registered for that event, even if those beans are in a 
context which is not active yet.

This happens for example in the following situation:

A 
UserLogOutFilter implements javax.servlet.Filter
 sends a UserSettingsChangeEvent.

A @ConversationScoped MyBusinessBean @Observes UserSettingsChangeEvent.

But at the time the servlet filter does run, there is no active 
ConversationContext yet. This leads to the following Exception:

javax.enterprise.context.ContextNotActiveException: WebBeans context with scope 
type annotation @ConversationScoped does not exist within current thread
        at 
org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:279)
        at 
org.apache.webbeans.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:201)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to