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
serializable?

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

        static HashMap userSessionMapArray = new HashMap();
        SecretKey       b =
KeyGenerator.getInstance("DESede").generateKey();
        QueryCryptUser  qcu = new QueryCryptUser(sessionID, b);
        userSessionMapArray.put(sessionID, qcu);


Note that I have tried to create the "QueryCryptUser" Class to
implements java.io.Serializable 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
www.path-solutions.com



Disclaimer
[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 [mailto:ch...@christopherschultz.net] 
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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Imad,

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
we
> store Users SESSION ID.
> 
> After one node shutdown, this Hashmap object is getting empty, note
that
> 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(key);
  System.out.print(" (");
  System.out.print((null == key ? "null" : key.getClass().getName()));
  System.out.print(") -> ");

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

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkru+DcACgkQ9CaO5/Lv0PAfgACbB7Vu9eKS/9rrfhYxqoBcKnv+
ARQAoKFbk70KLHU/dh+0CypVk839V2ku
=Vz81
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to