Hi all,
We’re seeing a recurring server-side error in a 2-node Hazelcast cluster, thrown on client connection close (not on SM resume). Hoping to find out whether this is known / a classloader config issue on our side or a plugin bug.
Environment
- Openfire: 5.0.3
- Hazelcast clustering plugin: 5.5.0 Release 1
- Cluster: 2 nodes
- Java: OpenJDK 17 (JRE, headless) · OS: Debian 12 (Bookworm) (containerised)
- Clients: WebSocket (C2S), XEP-0198 enabled with resume=“false”
What happens
On a client’s connection close, Openfire routes the final unavailable presence and removes the session from the clustered cache. Both the ClusteredCache.put (from setPresence) and ClusteredCache.remove (from removeSession) fail while Hazelcast (de)serializes ClientSessionInfo, with a ClassNotFoundException. It happens for many different users, on both nodes, roughly daily.
The missing class is usually Openfire’s own org.jivesoftware.openfire.cluster.NodeID, and in one case dom4j’s org.dom4j.tree.DefaultElement - i.e. core / core-dependency classes, not a custom plugin class.
Stack trace (representative):
ERROR org.jivesoftware.openfire.handler.PresenceUpdateHandler - Internal server error. Triggered by packet:
com.hazelcast.nio.serialization.HazelcastSerializationException: Problem while reading Externalizable class:
org.jivesoftware.openfire.session.ClientSessionInfo,
exception: java.io.IOException: java.lang.ClassNotFoundException: org.jivesoftware.openfire.cluster.NodeID
at com.hazelcast…ExternalizableSerializer.read(JavaDefaultSerializers.java:169)
…
at org.jivesoftware.openfire.plugin.util.cache.ClusteredCache.put(ClusteredCache.java:215)
at org.jivesoftware.util.cache.CacheWrapper.put(CacheWrapper.java:172)
at org.jivesoftware.openfire.session.LocalClientSession.setPresence(LocalClientSession.java:791)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateHandler.java:169)
…
at org.jivesoftware.openfire.SessionManager$ClientSessionListener.lambda$onConnectionClosing$1(SessionManager.java:1388)
Caused by: com.hazelcast.nio.serialization.HazelcastSerializationException: … ClassNotFoundException: org.jivesoftware.openfire.cluster.NodeID
at …MapProxyImpl.remove(…)
at org.jivesoftware.openfire.plugin.util.cache.ClusteredCache.remove(ClusteredCache.java:226)
at org.jivesoftware.openfire.SessionManager.removeSession(SessionManager.java:1313)
at org.jivesoftware.openfire.SessionManager$ClientSessionListener.lambda$onConnectionClosing$2(SessionManager.java:1397)
Secondary error on the same close (intermittent — when the socket was already gone):
java.lang.NullPointerException: Cannot invoke “org.eclipse.jetty.ee8.websocket.api.Session.close()”
because the return value of “…WebSocketClientConnectionHandler.getWsSession()” is null
at org.jivesoftware.openfire.websocket.WebSocketConnection.closeVirtualConnection(WebSocketConnection.java:76)
at org.jivesoftware.openfire.net.VirtualConnection.lambda$close$0(VirtualConnection.java:151)
…
ERROR org.jivesoftware.openfire.net.VirtualConnection - Could not close socket
Our concern is the downstream effect: if removeSession can’t complete across the cluster, stale session state lingers - we also see frequent “Found user that never left a previous conversation”, “Found remote session instead of local session”, and “Duplicate occupant” warnings, which we suspect are related.
Questions
- Is this a known issue on 5.0.3 / recent Hazelcast plugin? (I couldn’t find an existing report matching this exact signature…)
- Is the Hazelcast cache expected to be able to deserialize core classes like NodeID here - is this a plugin classloader bug, or a config/packaging problem on our side we can fix?