-
1. Re: SessionScoped bean created twice per session.
tdtappe Apr 13, 2011 8:34 AM (in response to tdtappe)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?
--Heiko
-
2. Re: SessionScoped bean created twice per session.
spinner.joserodolfo.freitas.gawab.com Apr 14, 2011 7:23 AM (in response to tdtappe)Hey Heiko,
take a look at:http://seamframework.org/Documentation/WhyIsTheConstructorInvokedTwiceWhenANormalScopedBeanIsCreated
and
http://techblog.joserodolfo.com/2011/04/the-proxied-nature-of-an-injected-bean-in-cdi/by normal scope it means cdi managed scope
-
3. Re: SessionScoped bean created twice per session.
spinner.joserodolfo.freitas.gawab.com Apr 14, 2011 7:29 AM (in response to tdtappe)Why is the constructor invoked twice when normal scoped bean is created
the proxied nature of an injected bean in cdi
It'd be very nice having an edit button on the forums
-
4. Re: SessionScoped bean created twice per session.
tdtappe Apr 14, 2011 9:12 AM (in response to tdtappe)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?--Heiko