webtier@glassfish.java.net

Re: Intermittent, but reproducible (!), corruption of the session map

From: <webtier_at_javadesktop.org>
Date: Mon, 19 Jul 2010 02:32:33 PDT

This problem turns out to be caused by using
@ManagedProperty(value = "#{sessionScope}") to access the session map
(via getters and setters).

As described in the original post it doesn't work in every build. When I access
the hashCode value of the session map itself I can see that it is 0 when I'm
encountering the problem, which should clearly never happen.

Reverting back to the long hand notation below to access the session map
and straight away everything works fine every time:

FacesContext.getCurrentInstance().getExternalContext().getSessionMap();

The only other information that I can think of that would be of interest is that I'm
putting a value into the session map from a request scoped managed bean and
accessing it again from a view scoped bean, but this clearly shouldn't matter at
all.

So something not right with the resource injection. I do have PrimeFaces 2.0.2
and RichFaces 4A2 libs included in my project, using Mojarra 2.0.3 release build.

Regards,
Brendan.
[Message sent by forum member 'healeyb']

http://forums.java.net/jive/thread.jspa?messageID=477942