tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Imad Hachem" <>
Subject RE: MISC; After one Tomcat Cluster node shutdown Session Replication working but a Hashmap object is getting empty
Date Mon, 02 Nov 2009 17:33:12 GMT
Dear chris,

Thanks for your reply.

You are right about the case of Tomcat Node non shutdown, HashMap is not
replicated correctly to the other node.

Note that I am saving a secretKey (javax.crypto.SecretKey) as a VALUE
for the sessionid KEY stored in the HashMap.

How can I make sure that this secretKey or all HaspMap data are

Note I am using the below code to store in the HashMap:

	static HashMap userSessionMapArray = new HashMap();
	SecretKey  	b =
	QueryCryptUser  qcu = new QueryCryptUser(sessionID, b);
	userSessionMapArray.put(sessionID, qcu);

Note that I have tried to create the "QueryCryptUser" Class to
implements but still facing the same problem and
HashMap not replicated to the 2nd Node.

Imad Hachem | Asst.Product Development Manager
e-Banking Department
Path Solutions
Tel: +961 1 697444 ext. 222
Fax: +961 1 696744

[The information contained in this e-mail message and any attached files
are confidential information and intended solely for the use of the
individual or entity to whom they are addressed. This transmission may
contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you have received this e-mail in
error, please notify the sender immediately and delete all copies. If
you are not the intended recipient, any disclosure, copying,
distribution, or use of the information contained herein is STRICTLY
PROHIBITED. Path Solutions accepts no responsibility for any errors,
omissions, computer viruses and other defects.]

-----Original Message-----
From: Christopher Schultz [] 
Sent: Monday, November 02, 2009 5:18 PM
To: Tomcat Users List
Subject: Re: MISC; After one Tomcat Cluster node shutdown Session
Replication working but a Hashmap object is getting empty

Hash: SHA1


On 11/1/2009 1:41 AM, Imad Hachem wrote:
> After setting a Tomcat Cluster of 2 nodes on separate machine, Session
> replication is working very fine except one library objects
> (QueryCrypt.jar included in this Web Project) having a Hashmap where
> store Users SESSION ID.
> After one node shutdown, this Hashmap object is getting empty, note
> all other session variables have been replicated successfully and
> SESSIONID.jvmRoute still the same which is correct and expected
> behavior.

If that node does /not/ shut down, can you observe that the HashMap is
correctly replicated to the other node? I suspect not.

My guess is that your HashMap has data other than just the SESSIONID,
and that data is not serializable.

Can you run this code against your HashMap in the session?

Map map = (Map)session.getAttribute("whatever");

for(Iterator i=map.entrySet().iterator(); i.hasNext(); )
  Map.Entry entry = (Map.Entry)i;

  Object key = entry.getKey();
  Object value = entry.getValue();

  System.out.print(" (");
  System.out.print((null == key ? "null" : key.getClass().getName()));
  System.out.print(") -> ");

  System.out.print(" (");
  System.out.print((null == value
                    ? "null"
                    : value.getClass().getName()));

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message