I have the autogenerated Agr.java schema file from avro. And I am seeing this error when attempting to cast to a GenericRecord.
(FileStreamer.java:processFile(181)) - java.lang.ClassCastException: records.Agr cannot be cast to org.apache.avro.generic.GenericRecord
It gets thrown from here--
Class avroClass = Class.forName("records.Agr");
GenericRecord avroClassObject = (GenericRecord) avroClass.newInstance();
I am able to run this successfully on the server but not locally on my windows machine. I am using the same build/.pom/etc.
Any insights would be appreciated
The issue was with my IDE setup, I needed to specify the classpath of the module in the run configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With