Tomcat/Kubernetes session replication

207 views
Skip to first unread message

Jeff Larsen

unread,
Jan 21, 2022, 5:09:35 PM1/21/22
to Hazelcast
I am trying to set up session replication with Tomcat 8.5 as a hazelcast client. I already have a hazelcast deployment in my kubernetes cluster (v4.2.1).

But I seem to be having class compatibility issues with hazelcast-tomcat85-sessionmanager:2.2 paired with hazelcast-all:4.2.1 I can get the hazelcast client to start up and save a session, but as soon as it tries to deserialize the session, I get a class cast exception. Likely because hazelcast-tomcsat85-sessionmanager is built against hazelcast 4.0.2. Some incompatibilities in com.hazelcast.nio.serialization.DataSerializable must have been introduced along the way from 4.0.2 to 4.2.1

So I tried hazelcast-all:4.0.2 but the kubernetes discovery configuration just didn't work. I get: 

com.hazelcast.config.properties.ValidationException: There is no discovery strategy factory to create 'DiscoveryStrategyConfig{properties={namespace=dev, service-port=5701, service-dns=haz
elcast-dev.dev.svc.cluster.local}, className='com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy', discoveryStrategyFactory=null}' Is it a typo in a strategy classname? Perhaps you forgot
to include implementation on a classpath?

I have no idea what to do with that. The discovery configuration worked just fine with the 4.2.1 libraries. I don't know what has changed in the configuration. Trying to find version-specific configuration documentation and examples is a very deep rabbit hole.

Why isn't the tomcat session manager being updated for newer versions?

Jeff Larsen

unread,
Jan 21, 2022, 5:23:00 PM1/21/22
to Hazelcast
So I tried hazelcast-all version 4.1.8 to see if there was a happy middle ground, but I get the same error as with 4.2.1, which is:

Caused by: java.lang.ClassCastException: com.hazelcast.session.HazelcastSession cannot be cast to com.hazelcast.nio.serialization.DataSerializable
at com.hazelcast.internal.serialization.impl.DataSerializableSerializer.readInternal(DataSerializableSerializer.java:152)

Reply all
Reply to author
Forward
0 new messages