The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

212084 (1) [Avatar] Offline
#1
Hi,

I am going through the Avro chapter, and have implemented the Avro Parser.

I am trying to run the JAR file with the example Check object, but I get:
Exception in thread "main" java.lang.ClassCastException: org.apache.avro.util.Utf8 cannot be cast to java.lang.String
	at plum.avro.Check.put(Check.java:58)
	at org.apache.avro.generic.GenericData.setField(GenericData.java:659)
	at org.apache.avro.specific.SpecificDatumReader.readField(SpecificDatumReader.java:119)
	at org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:230)
	at org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:174)
	at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:152)
	at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:144)
	at plum.AvroParser.fromJsonAvro(AvroParser.java:34)
	at plum.SchemaApp.main(SchemaApp.java:11)


Seems to be related to https://issues.apache.org/jira/browse/AVRO-1810

Anyone has a working example of this?