DaTaobao Tech
DaTaobao Tech
Aug 29, 2025 · Backend Development

Why HSF’s Hessian2 Serialization Fails with Java 9 Immutable Collections (Set.of)

When an HSF service receives a parameter created with Java 9's immutable collection factories such as Set.of(), the default Hessian2 serializer drops the collection elements, causing a NullArray InvalidObjectException and resulting in a SERVER_SERIALIZE_ERROR on the server side, which can be avoided by using mutable collections or a compatible serializer.

HSFImmutableCollectionsJava
0 likes · 24 min read
Why HSF’s Hessian2 Serialization Fails with Java 9 Immutable Collections (Set.of)