tags:

views:

17

answers:

1

I am working on JSF1.1 with JSP as presentation technology. I have a managed bean with an ArrayList and I display the list in as rows. Everything works fine. I have session replication with two server nodes and when I replicate the session, and put one of the cluster down, app is now on second cluster but the session attributes are lost.

I tried to print sessionMap using ExternalContext to see session attributes but that is null too.

What could be a possible reason?

+1  A: 

The attributes are likely not Serializable. That's a requirement to get them to persist on disk and/or to transfer as bytes over network.

To fix this, just ensure that all session attributes (including session scoped managed beans) implement Serializable like this:

public class SomeSessionClass implements Serializable {
    // ...
}

Don't forget to make any members Serializable as well whenever applicable. E.g.

public class SomeSessionClass implements Serializable {
    private SomeNestedClass foo; // Has to implement Serializable as well!
    // ...
}
BalusC

related questions