Hi Team, I am getting a ClassCastException in my flink job's business logic when using the below code to clone an object with newBuilder.
MyClass outEvent = new MyClass(); outEvent = (MyClass) MyClass.newBuilder(inEvent).build(); Exception : Caused by: java.lang.ClassCastException: com.avro.mon.nfConsumerIdentification cannot be cast to com.avro.mon.nfConsumerIdentification Also, In Flink documention I found a description of similar problem - https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/ops/debugging/debugging_classloading/#x-cannot-be-cast-to-x-exceptions But, as per the solution mentioned in the document we could not package the avro jar in the job, we can only add the avro jar to the Flink /lib folder. Is there any way we can clear the cache in Avro or any other way we can solve this? Any leads would be appreciated. Thanks and Regards Mahima Agarwal