The problem with the sessionCreated event being fired twice seems to occur only if in an observer of a the event fired in sessionCreated (via BeanManager.fireEvent) references a SessionScoped bean (via injection).
Is it not allowed to uses SessionScoped beans in the context of a sessionCreated event? Maybe the CDI session context isn't fully initialized at that time?
take a look at:
by normal scope it means cdi managed scope
Ahhh... that explains a lot. Missed that one.
Thanks a lot, Jose!
But I still have two problems/questions:
1) Why is the sessionCreated event fired twice when using SessionScoped beans in the context of this event?
2) Why do I sometimes get injected beans with its fields set to null that should have been set via field injection?