users@glassfish.java.net

In Multi-Homing Glassfish Cluster Session Replication Fails

From: <forums_at_java.net>
Date: Mon, 15 Oct 2012 07:25:53 -0500 (CDT)

I tried to create a cluster and deploy a sample app to test session
replication between different hosts, but I has not been successful, I have no
idea what should I do,can any one help me thanks. My environment : Os: two
linux machine , IP: 10.10.7.116 named :pingtai-test1 (DAS two instances) ;
IP:10.10.7.117(two instances) JDK: 1.6.0_22. Glassfish: 3.1.2.2 zip archive
linux My configurations: Cluster: Multicast IP as follows ,I test Multicast
use ./asadmin validate-multicast in each machine , It works successfully.
There are four instances as follows: (node localhost-domain1 in 10.10.7.116
and ssh-117 in 10.10.7.117 , every node has two instances) Application deploy
Configuration: I enabled the Availability property as follows: All other
configuration used the default configuration of the glassfish . My web
Application: My web.xml config file : My glassfish-web.xml config file: Only
a index.jsp file as follows: <%_at_page contentType="text/html"
pageEncoding="UTF-8"%> <%_at_page import="java.util.Enumeration"%> JSP Page
======== SESSION FORM
========================================================

<% if (request.getParameter("sessionName") != null &&
request.getParameter("sessionValue") != null) { HttpSession httpSession =
request.getSession();
httpSession.setAttribute((String)request.getParameter("sessionName"),
(String)request.getParameter("sessionValue")); }
System.out.println("--------------excute--------"); %> your session name :
your session value :
======== YOUR SESSIONS
=======================================================

<% Enumeration sessionNames = session.getAttributeNames(); while
(sessionNames.hasMoreElements()) { String mySessionName =
sessionNames.nextElement().toString(); String mySession =
request.getSession().getAttribute(mySessionName).toString();
out.print(mySessionName+ " --> "+mySession + "
"); } out.print(request.getSession().getId()); %> That’s all about my test,
In the follow jsp tests , the session between 116 and 117 can not replicated
correctly. Result as follows: I first add two attribute to session in 116,
and the two instances have the same session information. But 117 does not get
the session information. Any body knows how to resolve this problem ,does I
lost some config or go wrong way? If anyone knows that , please tell me
,thank ! Best regards to everyone !   Thanks!

--
[Message sent by forum member 'zhuixunzhe_sina']
View Post: http://forums.java.net/node/891467