I am working on switching my application from Java serialization to Jackson. I am running up against an error in my custom durable state store plugin that I am having trouble tracking down.
Here is the relevant portion of the stack trace:
Caused by: java.lang.IllegalStateException: Can't access current ActorSystem, Serialization.currentTransportInformation was not set.
at akka.serialization.jackson.ActorSystemAccess.currentSystem(ActorSystemAccess.scala:19)
at akka.serialization.jackson.ActorSystemAccess.currentSystem$(ActorSystemAccess.scala:15)
at akka.serialization.jackson.TypedActorRefSerializer.currentSystem(TypedActorRefModule.scala:37)
at akka.serialization.jackson.TypedActorRefSerializer.serialize(TypedActorRefModule.scala:41)
at akka.serialization.jackson.TypedActorRefSerializer.serialize(TypedActorRefModule.scala:37)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
... 27 common frames omitted
And this is how I’m performing the state serialization:
Serialization serialization = SerializationExtension.get(system);
Serializer serializer = serialization.findSerializerFor(value);
int serializerId = serializer.identifier();
String manifest = Serializers.manifestFor(serializer, value);
byte[] state = serializer.toBinary(value);
I am not sure how else I should be passing the system into the serializer, or why if I provide it there Jackson wouldn’t have access to it. I’ve looked at a few other durable state store implementations floating around online and their serialization code all look pretty similar to this.
7 posts - 3 participants