Niraj Niraj - 10 months ago 74
Java Question

Kafka Avro Deserialization Issue (java.lang.NoSuchMethodException: java.util.UUID.<init>(java.lang.String)

I am attempting to deserialize an Avro object from a Kafka stream and am seeing:

org.apache.avro.AvroRuntimeException: java.lang.NoSuchMethodException: java.util.UUID.<init>(java.lang.String)

Java UUID lacks a default empty constructor and so it seems like I need to write a custom deserializer. I wrote a new class that extended
but when debugging I did not break into that class. I want to use this deserializer along with a generic deserializer (I figured this is possible because it is with Jackson).

Am I missing something simple that I need to do?

Answer Source

Turns out I just needed to write a custom Avro encoder!