我是avro的新手。我想测试avro-rpc,并使用avro-1.7.5.jar,avro-ipc-1.7.5和avro-tools-1.7.5.jar编写一些代码。 当我运行测试代码时,我得到以下例外:
java.lang.ClassCastException: org.apache.avro.ipc.generic.GenericRequestor cannot be cast to org.apache.avro.generic.IndexedRecord
at org.apache.avro.generic.GenericData.getField(GenericData.java:576)
at org.apache.avro.generic.GenericData.getField(GenericData.java:591)
at org.apache.avro.generic.GenericDatumWriter.writeField(GenericDatumWriter.java:112)
at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:104)
at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:66)
at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:58)
at org.apache.avro.ipc.generic.GenericRequestor.writeRequest(GenericRequestor.java:85)
at org.apache.avro.ipc.Requestor$Request.getBytes(Requestor.java:473)
at org.apache.avro.ipc.Requestor.request(Requestor.java:147)
at org.apache.avro.ipc.Requestor.request(Requestor.java:101)
at org.apache.avro.ipc.generic.GenericRequestor.request(GenericRequestor.java:58)
at avro.rpc.Client.sendMessage(Client.java:49)
at avro.rpc.Client.run(Client.java:60)
at avro.rpc.Client.main(Client.java:79)
我无法弄清楚avro-1.7.5中是否存在一些错误,或者我应该采取哪些配置来使其正常工作! 所有建议非常感谢!
答案 0 :(得分:0)
修复了我一天多次犯的错误!但是,我的情况略有不同,因为我的情况与MapReduce工作有关。
我仍然认为,这可能有所帮助。
以下是主要内容: