Reputation: 1764
I use javax.xml.crypto.dsig.XMLSignature
in Java project to sign an org.w3c.dom.Document
object (within Signature.Object element).
I then need to serialize the signature to store it in Hazelcast
.
The XMLSignature does not implement Serializable
. How can I make the XMLSignature serializable to be able to store in Hazelcast?
I got this Hazelcast exception on saving map with XMLSignature object:
com.hazelcast.nio.serialization.HazelcastSerializationException: java.io.NotSerializableException: org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignature
I tried to wrap XMLSignature to MyXMLSignature to class which implements Serializable with no success.
Upvotes: 0
Views: 147
Reputation: 574
I try to avoid system and other third-party classes in my Hazelcast-stored entities, but if I absolutely have to I'd either subclass or wrap the non-serializable class and implement DataSerializable. You can get fancy with IdentifiedDataSerializable and Portable, but I doubt it is necessary in this context.
Standard Serializable is a horrible choice anyway performance-wise. It shows during queries even on 20K members. And it needs to be implemented at the most inner superclass level to serialize its content, which you cannot add there.
Read this for comparison of different serialization methods. Comparing Hazelcast Serialization Methods
Upvotes: 1