I just noticed that we are facing Kryo Issues with a new payload in one of our new Streams in Spring XD (We are planning to jump to Spring Cloud Data Flow soon, so suggestion based on it, might no be applicable right now :(
This is part of the log I saw:
Caused by: java.lang.NoClassDefFoundError: Lcom/xxx/yyy/MyEnumClassEnum;
at java.lang.Class.getDeclaredFields0(Native Method) ~[na:1.8.0_212]
at java.lang.Class.privateGetDeclaredFields(Class.java:2583) ~[na:1.8.0_212]
at java.lang.Class.getDeclaredFields(Class.java:1916) ~[na:1.8.0_212]
at com.esotericsoftware.kryo.serializers.FieldSerializer.rebuildCachedFields(FieldSerializer.java:215) ~[kryo-shaded-3.0.3.jar:na]
at com.esotericsoftware.kryo.serializers.FieldSerializer.rebuildCachedFields(FieldSerializer.java:182) ~[kryo-shaded-3.0.3.jar:na]
at com.esotericsoftware.kryo.serializers.FieldSerializer.<init>(FieldSerializer.java:155) ~[kryo-shaded-3.0.3.jar:na]
... 60 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.xxx.yyy.MyEnumClassEnum
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_212]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_212]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_212]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_212]
... 66 common frames omitted
I also noticed, it is happening just with Enum classes. Some fields in that Pojo Object are enum, and I saw it is just failing there.
Edit 1: I have checked the jar file related to my SpringXD module. Inside the jar I found the artifact jar, I opened it and the class is inside. So this is not a problem related to a not existing class inside the jar.
I might share the POJO structure as it is autogenerated. Maybe the way the Enum it is being serialized and after that used my be the root issue.
How should I deal with this issue knowing that just the Enum field is the one triggering the ClassNotFound NoClassDefFoundError