EE Session Failover: Invalid session key

Just wondering if anybody else has seen the error "Invalid session key" when failover in an EE cluster takes place.

I've got an EE app running on a 2-pair cluster, behind Apache with mod_loadbalancer. The app has been enabled for high availability in both the console, and in all the descriptor files. (It's a SFSB with a servlet).

When testing failover, I run the app successfully on the first server, and note it's JROUTE. I then shutdown this server, and attempt to hit the app again, as it should failover to the second server.

When failover occurs, the JROUTE cookie changes - which indicates that the loadbalancer has detected the dead server and has re-routed the request to the second server.

Trouble is, the second server is unable to process the request.

I see the error "No persisted data found for session (+session id)".

and next:

"javax.ejb.NoSuchLocalException: Invalid session key"

It seems to suggest to me that the second server cannot retrieve the EJB from the HADB as it thinks it has an invalid session.

It seems to me like the app isn't storing the EJB data in the HADB, however, the HADB store appears to be working as I've tested the sample app, clusterjsp, and it seems to store the HTTP session information in the HADB fine as failover works.

Is there something in my application I might be missing which is preventing data from being stored in the HADB. Any ideas would be appreciated.

For what its worth, its a Appserver 8.1EE UR2 patch 9 cluster.

[1554 byte] By [tourtech] at [2007-11-26 8:26:15]
# 1
Hi,As per error message, it looks like session is not stored in HADB.You can query database and check whether session data is getting/modified. You also need to really check configuration whether you have enabled availability to HADB.Thanks,-Balaji.
BalajiKoutharapu at 2007-7-6 21:40:18 > top of Java-index,Application & Integration Servers,Application Servers...
# 2

Hey Balaji

I actually sorted the problem out today.

I realized that my SFSB wasn't transaction-based, and therefore the container wasn't checkpointing any data to the HADB.

I already knew that the HADB was working fine as I was able to get the sample sfsbFailover application to work. After I compared the sample to our bean, I realized the big difference was that the sample bean was transactional and thus the EJB container would automatically checkpoint data to the persistent HADB store, whereas our one wouldn't.

By adding methods to the <checkpoint-at-end-of-method> section of the sun-ejb-jar.xml, I was able to force the EJB container to persist the bean to the HADB store, thus making it available after failover.

(Closely reading the "Note--" section in Ch. 8 of the HADB docs also pointed this out!).

Thanks for your help. BTW - do you know of any utilities you can use to view the contents of the HADB store; or do you just manipulate it with SQL. I haven't really read up on much of the HADB internals yet.

Thanks again.

tourtech at 2007-7-6 21:40:18 > top of Java-index,Application & Integration Servers,Application Servers...