Avro.avroexception: genericrecord required to write against record schema but found avro.generic.genericrecord

Please help to solve this issue.