Re: @Observes @Initialized(ApplicationScoped.class) No active contexts for RequestScoped

2018-04-09 Thread Luís Alves
Thanks John. DS allows to programmatically activate the scope (Container Control Module). Not sure if it works the same way of @ActivateRequestContext. Nevertheless it's seems a workaround. I must agree with Struberg, it should be activated, unless there's some good reason it can't be activated in

Re: @Observes @Initialized(ApplicationScoped.class) No active contexts for RequestScoped

2018-04-09 Thread Mark Struberg
Indeed you are right. It's only defined to MUST be active for EJBs and asynchronous observer methods. But funnily not in synchronous CDI bean observers :/ LieGrue, strub > Am 09.04.2018 um 14:24 schrieb Martin Kouba : > > Dne 9.4.2018 v 14:20 Mark Struberg napsal(a): >>

Re: @Observes @Initialized(ApplicationScoped.class) No active contexts for RequestScoped

2018-04-09 Thread John D. Ament
If you're on CDI 2.0 you can add it yourself if you want (via annotation - @ActivateRequestContext). However, sounds like you're on WF 10.1, so you'd have to programmatically register it. On Mon, Apr 9, 2018 at 8:41 AM Luís Alves wrote: > It partially worked on

Re: @Observes @Initialized(ApplicationScoped.class) No active contexts for RequestScoped

2018-04-09 Thread Martin Kouba
Dne 6.4.2018 v 18:37 Luís Alves napsal(a): Hello, I'm getting: Caused by: java.lang.RuntimeException: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.RequestScoped On bootstrap: @ApplicationScoped public class

Re: @Observes @Initialized(ApplicationScoped.class) No active contexts for RequestScoped

2018-04-09 Thread Luís Alves
I still didn't tested it...but I was hoping that @Observes @Initialized(ApplicationScoped.class) was executed after @PostConstruct 1st: @PostConstruct 2nd: public void init(@Observes @Initialized(ApplicationScoped.class) Object init) isn't this the case? Why on @PostConstruct we have scope and

Re: @Observes @Initialized(ApplicationScoped.class) No active contexts for RequestScoped

2018-04-09 Thread Mark Struberg
According to the CDI spec every call to a business method must have the Request Context activated. And this very observer IS a business method. LieGrue, strub > Am 09.04.2018 um 10:58 schrieb Martin Kouba : > > Dne 9.4.2018 v 10:36 Luís Alves napsal(a): >> I still didn't

Re: @Observes @Initialized(ApplicationScoped.class) No active contexts for RequestScoped

2018-04-09 Thread Martin Kouba
Dne 9.4.2018 v 14:20 Mark Struberg napsal(a): According to the CDI spec every call to a business method must have the Request Context activated. Mark, this is very wrong! Which part of the spec dou you refer? And this very observer IS a business method. LieGrue, strub Am 09.04.2018 um