spring-kafka icon indicating copy to clipboard operation
spring-kafka copied to clipboard

Getting ClassCast Exception : GenericData$Record cannot be cast to org.apache.avro.specific.SpecificRecordBase

Open ghost opened this issue 7 years ago • 1 comments

While using the given AvroSerializer and Deserializer in Serde with Kafka streams , I am facing ClassCastException GenericData$Record cannot be cast to org.apache.avro.specific.SpecificRecordBase.

config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.serdeFrom(new AvroSerializer<MemberMeasureKey>() , new AvroDeserializer<MemberMeasureKey>(MemberMeasureKey.class)).getClass()); config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.serdeFrom(new AvroSerializer<MemberMeasureValue>() , new AvroDeserializer<MemberMeasureValue>(MemberMeasureValue.class)).getClass());

Please help me on this.

ghost avatar Aug 21 '18 06:08 ghost

Same Issue

ShiyangHuang avatar Jan 07 '19 21:01 ShiyangHuang