Hello !
I'm new with wildfly and LB like mod_cluster, but wanted to test it. So I've started with the guide at:
WildFly 8 Cluster Howto - WildFly 8 - Project Documentation Editor
Everything works fine, but Session replication don't work.
Exact: It seems, that my Session-Object is not replicated, but the session ID is replicated though. I'm confused about that.
My Servlet-Example does the following output:
out.println("RUNNING on JBoss bound to " + System.getProperty("jboss.server.name")+"<br><br>");
Date d=null;
HttpSession ses=request.getSession(false);
if (ses==null) {
ses=request.getSession(true);
d=new Date();
ses.setAttribute("time", d);
}
else {
d=(Date)ses.getAttribute("time");
}
out.println("TIME in Session: "+d.toString()+"<br>");
out.println("SESSION: "+request.getSession().getId());
Accessing the Servlet several times, I get the following:
First access:
RUNNING on JBoss bound to server-one
TIME in Session: Thu May 08 09:35:36 CEST 2014
SESSION: U6hJSfkLw4iu2AxpWzSPxcsR
Second access:
RUNNING on JBoss bound to server-one1
TIME in Session: Thu May 08 09:37:40 CEST 2014
SESSION: U6hJSfkLw4iu2AxpWzSPxcsR
If I shutdown one of the Wildfly-Servers, the other one is doing the job, but with its own session-object.
I've done everything the tutorial above and other one's advise, but there seems to be no solution for that.
My environment: Apache 2.2.25 with modcluster 1.2.6 on Windows, Wildfly DC and HC ("server-one") on RHEL-Server 1 and Widlfly HC ("server-one1") on RHEL-Server 2.
I've got no error-logs in apache- or wildfly-logs.
Would really appreciate any helpful answer.
Thank you!
Chris
I sounds like either your servers are not using the "ha" or "full-ha" profile (this is configured per server-group in domain.xml), or your web application is not <distributable/> (defined in web.xml).