How to diagnose non-working session replication?

Clemens Eisserer

Hi there,

To be able to test a web-application in an environment similar to the
final production system, I've set up a glassfish-4.1 cluster with a
apache+mod_jk load-balancer (round-robin) in front.

Everything seems to work fine (load-balancer, cluster, deploying to
the cluster), except for session replication ( an identical setup
usnig a clustered tomcat-8 works as expected).

I performed the following steps:
- <distributeable/> tag added to web.xml
- enabled availability in the cluster-configuration (replicated /
web-method / scope: session)
- enabled availability when deploying the web application

also, the instances seem to find each other (log appended at the bottom).

Yet, even with the most simple test-servlet, each trime a request is
directed to a different instance the original session id is
invalidated, a new one is generated and all session data is lost.

I am quite lost - any ideas how to diagnose the issue further are
highly appreciated.

Thank you in advance, Clemens

Domain-Log of server1 (admin + i1):

[2017-08-08T12:08:04.315+0200] [glassfish 4.1] [INFO]
[view.window.view.change] [ShoalLogger] [tid: _ThreadID=25
_ThreadName=GMS ViewWindowThread Group-c1] [timeMillis: 1502186884315]
[levelValue: 800] [[
GMS1092: GMS View Change Received for group: c1 : Members in view
for JOINED_AND_READY_EVENT(before change analysis) are :
1: MemberId: i1, MemberType: CORE, Address:
2: MemberId: i2, MemberType: CORE, Address:
3: MemberId: server, MemberType: SPECTATOR, Address:

[2017-08-08T12:08:04.316+0200] [glassfish 4.1] [INFO]
[membership.snapshot.analysis] [ShoalLogger] [tid: _ThreadID=25
_ThreadName=GMS ViewWindowThread Group-c1] [timeMillis: 1502186884316]
[levelValue: 800] [[
GMS1016: Analyzing new membership snapshot received as part of
event: JOINED_AND_READY_EVENT for member: i2 of group: c1]]

[2017-08-08T12:08:04.317+0200] [glassfish 4.1] [INFO] [] [ShoalLogger]
[tid: _ThreadID=25 _ThreadName=GMS ViewWindowThread Group-c1]
[timeMillis: 1502186884317] [levelValue: 800] [[
GMS1025: Adding Joined And Ready member: i2 group: c1 StartupState:

[2017-08-08T12:08:08.915+0200] [glassfish 4.1] [INFO] []
[javax.enterprise.system.core] [tid: _ThreadID=175
_ThreadName=pool-28-thread-2] [timeMillis: 1502186888915] [levelValue:
800] [[
Waiting for i2 to start
Successfully started the instance: i2
instance Location: /home/ce/glassfish4/glassfish/nodes/localhost.localdomain/i2
Log File: /home/ce/glassfish4/glassfish/nodes/localhost.localdomain/i2/logs/server.log
Admin Port: 24849
Command start-local-instance executed successfully.]]

[2017-08-08T12:08:09.185+0200] [glassfish 4.1] [INFO]
[NCLS-CLSTR-30001] [javax.enterprise.cluster.gms.admin] [tid:
_ThreadID=122 _ThreadName=admin-listener(10)] [timeMillis:
1502186889185] [levelValue: 800] [[
GMSAnnounceAfterStartClusterCommand: exitCode:SUCCESS members [i1,
i2] clusterMembers:[i1, i2]]]

[2017-08-08T12:08:09.222+0200] [glassfish 4.1] [INFO]
[] [ShoalLogger] [tid: _ThreadID=122
_ThreadName=admin-listener(10)] [timeMillis: 1502186889222]
[levelValue: 800] [[
GMS1098: GMS:Announcing GroupStartup[COMPLETED_SUCCESS] for group:
c1 members: i1,i2,]]

[2017-08-08T12:08:09.223+0200] [glassfish 4.1] [INFO]
[mgmt.masternode.groupstartcomplete] [ShoalLogger] [tid: _ThreadID=122
_ThreadName=admin-listener(10)] [timeMillis: 1502186889223]
[levelValue: 800] [[
GMS1062: GroupStart for group: c1 State: COMPLETED_SUCCESS Started
Members: i1,i2,]]