Unlike JSF managed beans, CDI managed beans are not saved directly by their managed bean on the session map. Instead, they are stored in server memory using the CDI manager implementation (Weld, OpenWebBeans, etc.), using, for example, the session identifier as a key.
So the trick you used there is not applicable to managed CDI beans. You need to look for an alternative approach. The correct approach in this particular case is to use @ConversationScoped
instead of @SessionScoped
. Properly designed web applications should never need to manually close an area. So using @SessionScoped
for conversation / thread was already wrong in the first place.
source share