Description
Kryo classes are part of Flink API and hence move between Flink's core (serializers) and the user-application (Avro-Kryo-utils).
Duplicating the kryo dependency through reversed classloading yields problems. If Kryo is in the user application jar, together with Avro, the following error happens:
(this seems a semi-bug in the JVM, because this should clearly be a ClassCastException, not such a cryptic byte code error).
java.lang.VerifyError: Bad type on operand stack Exception Details: Location: org/apache/flink/formats/avro/utils/AvroKryoSerializerUtils.addAvroGenericDataArrayRegistration(Ljava/util/LinkedHashMap;)V @23: invokespecial Reason: Type 'org/apache/flink/api/java/typeutils/runtime/kryo/Serializers$SpecificInstanceCollectionSerializerForArrayList' (current frame, stack[7]) is not assignable to 'com/esotericsoftware/kryo/Serializer' Current Frame: bci: @23 flags: { } locals: { 'org/apache/flink/formats/avro/utils/AvroKryoSerializerUtils', 'java/util/LinkedHashMap' } stack: { 'java/util/LinkedHashMap', 'java/lang/String', uninitialized 6, uninitialized 6, 'java/lang/Class', uninitialized 12, uninitialized 12, 'org/apache/flink/api/java/typeutils/runtime/kryo/Serializers$SpecificInstanceCollectionSerializerForArrayList' } Bytecode: 0x0000000: 2b12 05b6 000b bb00 0c59 1205 bb00 0d59 0x0000010: bb00 0659 b700 0eb7 000f b700 10b6 0011 0x0000020: 57b1