Seam, IntervalRender and SessionExpiredException  XML
Forum Index -> JBoss Seam Integration
Author Message

Joined: 19/Oct/2009 00:00:00
Messages: 9

Hi everybody, I'm building one Icefaces application (v1.8.2) with ajax push using the interval render.

When I deployed the application on the pre-production enviroment I receveid one message from the QA team telling about problems with Session Expired messages.

Looking at the log I was surprised to see that there were 40.000 Threads Stack Traces with the SessionExpiredException on they.

Looking at the code it seems that the Interval Render is creating threads to update pages (views) from users that have they session expired. Analysing more I saw that RunnableRender.run have one method (testSession) that is executed only for seam enviroments and that this method trys to call Session.getAttributes(). But the Session object is one ProxyHttpSession from Icefaces that catch the original IllegalStateException (for which the run method have one catch block) and wrap it into one SessionExpiredException that is not expected int the run method. This cause the Thread to die with this exception.

Can I classify this as a Icefaces Bug?

Have anyone faced this problem?

Enviroment: JBoss Seam 2.2.0; Icefaces 1.8.2; Tomcat 6.0.29 / Weblogic 10.3.2

Thanks in advance,

PS: Just want to know, there will be one 1.8.3 release of icefaces?

Joined: 26/Oct/2004 00:00:00
Messages: 874

Logging must be configured in such a way that an uncaught RuntimeException that causes the Thread to exit is logged. This could be considered a bug, so please create a JIRA.

Joined: 03/Oct/2008 00:00:00
Messages: 12

This is an old thread but I don't see a Jira and I'm having this problem too.

Was there any resolution?

I get the exception:

 Exception in thread "Render Thread - 3024" com.icesoft.faces.webapp.http.core.SessionExpiredException: User session has
 expired or it was invalidated.
         at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttributeNames(ProxyHttpSession.java:93)
         at com.icesoft.faces.async.render.RunnableRender.testSession(RunnableRender.java:186)
         at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:135)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Thread.java:619)
 Caused by: java.lang.IllegalStateException: HttpSession is invalid
         at weblogic.servlet.internal.session.SessionData.getAttributeNames(SessionData.java:459)
         at com.icesoft.faces.webapp.http.servlet.ProxyHttpSession.getAttributeNames(ProxyHttpSession.java:91)
         ... 5 more

It looks like this exception occurs at the same interval I've set the interval renderer for.

My guess is that my Seam page scoped bean @Destroy lifecycle callback that leaves the render group doesn't get called correctly when the session expires. I will have to investigate more when I get the chance, unless someone else has any ideas?

     public void dispose() {
    public void leaveRenderGroups() {
    public void leaveRenderGroup(GroupAsyncRenderer renderer) {
         if (renderer!=null) {
             logger.debug("Removing instance of #0 from renderer #1",this.getClass().getSimpleName(),renderer.getName());
             if (renderer.isEmpty()) {

Joined: 03/Oct/2008 00:00:00
Messages: 12

I was right. Session expiration does not cause the Destroy life cycle methods on Page scope beans to be called, so they don't leave the interval render group.

My workaround was to create a session scoped 'registry' bean which page scoped beans relying on the interval renderer register themselves with upon creation, and deregister from when they are destroyed.

When the session expires, the Destroy method is called on the 'registry' bean, which iterates over any remaining page scoped beans it has a reference to and forces them to leave their render groups.

It's a hack, but it gets around the lack of lifecycle callback for lesser than session scope beans when the session expires.

Joined: 20/Feb/2007 00:00:00
Messages: 1396

If I remember correctly, there were a few problems along this line with the management of Page scoped beans and Seam 2 (I don't believe there is a Page scope in Seam 3, but I haven't looked at it lately). Since Seam interceptors manage the Page scoped objects, that would be something probably to do with Seam (unless you can create a non-ICEfaces case which behaves differently and then we should be taking a look at it).
If you want to pursue this in greater depth, that would be a recommendation.

Joined: 03/Oct/2008 00:00:00
Messages: 12

Yes this is ultimately IMO a Seam issue.

From an Icefaces perspective there could be some kind of handling when attempting to push render to expired sessions, and consequently evicting related components from the Renderer, but that's probably a band-aid solution.
Forum Index -> JBoss Seam Integration
Go to:   
Powered by JForum 2.1.7ice © JForum Team