2 Replies Latest reply on Jul 23, 2012 10:34 AM by Sueleyman Vurucu

    HOWTO use Conversation or SessionScope withot JSF

    Sueleyman Vurucu Expert

      Hi community,


      I have some CDI-beans which are injected by a  EJB singleton bean. Lets call this beans as ControllerBeans.


      The Controller beans should receive events over CDI-Event mechanism. Acutally these beans are in @Dependent scope. And every event reception will be handled by a new bean istance. But that behavior is wrong for me need.


      So I must therefore have Session or ConversionScoped bean for my ControllerBeans. Then I can receive events with @Observes(receive = IF_EXISTS) right ??.


      If I inject a Conversation in my Singleton EJB and try to start it then I get an Error like Caused by: javax.ejb.EJBException: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped


      The question is how can I create a session or conversation context without JSF ?? Or is that not possible ??