Tomcat session replication with Hazelcast:
https://github.com/hazelcast/hazelcast-tomcat-sessionmanager
Downloaded the hazelcast-5.3.0.zip, it has hazelcast-5.3.0.jar (16M), but it does not have hazelcast-all-5.3.0.jar.
Following the instruction for P2P.
added hazelcast-5.3.0.jar and hazelcast-tomcat9-sessionmanager-2.2.jar to tomcat/lib.
No hazelcast.xml.
server.xml
<Listener className="com.hazelcast.session.P2PLifecycleListener" />
context.xml:
<Manager className="com.hazelcast.session.HazelcastSessionManager" sticky="false"/>
When starting tomcat9 in kubernetes cluster, there are lots of errors like:
03-Jun-2023 21:26:31.863 WARNING [hz.SESSION-REPLICATION-INSTANCE.IO.thread-in-1] com.hazelcast.internal.server.tcp.TcpServerConnection.null [10.1.1.2]:5701 [dev] [5.3.0] Connection[id=2, /10.1.1.2:40177->/10.1.0.234:6446, qualifier=null, endpoint=[10.1.0.234]:6446, remoteUuid=null, alive=false, connectionType=NONE, planeIndex=-1] closed. Reason: Exception in Connection[id=2, /10.1.1.2:40177->/10.1.0.234:6446, qualifier=null, endpoint=[10.1.0.234]:6446, remoteUuid=null, alive=true, connectionType=NONE, planeIndex=-1], thread=hz.SESSION-REPLICATION-INSTANCE.IO.thread-in-1
java.lang.IllegalStateException: Unknown protocol: J
at com.hazelcast.internal.server.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:132)
at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:137)
at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:383)
at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:368)
at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:294)
at com.hazelcast.internal.networking.nio.NioThread.executeRun(NioThread.java:249)
03-Jun-2023 21:27:22.164 WARNING [hz.SESSION-REPLICATION-INSTANCE.IO.thread-in-2] com.hazelcast.internal.server.tcp.TcpServerConnection.null [10.1.1.2]:5701 [dev] [5.3.0] Connection[id=102, /10.1.1.2:40583->/10.1.0.234:6446, qualifier=null, endpoint=[10.1.0.234]:6446, remoteUuid=null, alive=false, connectionType=NONE, planeIndex=-1] closed. Reason: Exception in Connection[id=102, /10.1.1.2:40583->/10.1.0.234:6446, qualifier=null, endpoint=[10.1.0.234]:6446, remoteUuid=null, alive=true, connectionType=NONE, planeIndex=-1], thread=hz.SESSION-REPLICATION-INSTANCE.IO.thread-in-2
java.lang.IllegalStateException: Unknown protocol: 1
at com.hazelcast.internal.server.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:132)
at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:137)
at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:383)
at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:368)
at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:294)
at com.hazelcast.internal.networking.nio.NioThread.executeRun(NioThread.java:249)
Where is Protocol J/1 coming from?
com.hazelcast.internal.server.tcp.TcpServerConnection.null: null?
hazelcast.xml is required?