I get the following error when trying to serialize a SimpleDirectedGraph:
com.esotericsoftware.kryo.KryoException: java.lang.IllegalArgumentException: Unable to create serializer "com.esotericsoftware.kryo.serializers.FieldSerializer" for class: org.jgrapht.graph.SimpleDirectedGraph
My internet search regarding this type of error returns a lot of people recommending the user update to the ASM 4.0 library. I am using Kryo 2.2 All, which includes the ASM 4.0 library. I also tried including the ASM 4 library on its own just in case, but no luck.
I have tried serializing simpler objects such as ArrayList. Those go fine. I am not clear why kryo is failing to serialize this graph class. Does anyone have an idea?
Update: Since I am working with a graph, I have tried implementing the experimental "continuations" branch of kryo https://github.com/EsotericSoftware/kryo/issues/103
Unfortunately, I still receive the same error.
Update: I think the trick might be using a different kind of serializer. Unfortunately, I can't seem to find one that will work with a SimpleDirectedGraph. BeanSerializer only serializes the first object layer. Nested objects don't seem to get serialized. The other serializers just throw the same error as FieldSerializer. Is there a serializer that folks normally use with graphs?