You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Shlok Thakur <sh...@fonantrix.com> on 2013/06/14 10:30:49 UTC

Issue with Protobuf and Thrift content type

Hi,

                

In my Java application,I want to provide support for Avro, Thrift and
Protobuf. I am using java classes generated by avro schema and  avro idl.
When I use ProtoBufDatumReader and ProtoBufDatumWriter classes to support
encode and decode Protobuf content. I get following exception:

java.lang.RuntimeException: java.lang.NoSuchMethodException:
org.openrtb.common.api.BidRequest.getDescriptor()

      at
org.apache.avro.protobuf.ProtobufData.getSchema(ProtobufData.java:181)

      at
org.apache.avro.protobuf.ProtobufDatumWriter.<init>(ProtobufDatumWriter.java
:36)

      at
org.openrtb.dsp.core.DemandSideServerTest.writeBidRequest(DemandSideServerTe
st.java:293)

      at
org.openrtb.dsp.core.DemandSideServerTest.protobufRespondTest(DemandSideServ
erTest.java:263)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.
java:44)

      at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.j
ava:15)

      at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.ja
va:41)

      at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.jav
a:20)

      at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28
)

      at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunne
r.java:79)

      at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
a:71)

      at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
a:49)

      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

 

Similarly Thrift content type is also not working for me. Following is the
exception:

java.lang.NullPointerException: null of org.openrtb.common.api.BidRequest

      at
org.apache.avro.generic.GenericDatumWriter.npe(GenericDatumWriter.java:93)

      at
org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:87)

      at
org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:58)

      at
org.openrtb.dsp.core.DemandSideServerTest.writeBidRequest(DemandSideServerTe
st.java:295)

      at
org.openrtb.dsp.core.DemandSideServerTest.thriftRespondTest(DemandSideServer
Test.java:275)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

 

pls find the attachment to complete stack trace for  Protobuf & Thirft issue


Can you pls advice and help me to resolve this issue.

 

Regards

Shlok Thakur