ruby-protobuf
ruby-protobuf copied to clipboard
Protobuf generated by ruby client can't be deserialized by java server
I have written a ruby client which makes a REST call to a java server using the AddressBook example. When the protobuf in being deserialized by java, I am getting the following exception even though 'id' property was set in ruby client:
: com.google.protobuf.UninitializedMessageException: Message missing required fields: id at com.google.protobuf.AbstractMessage$Builder.newUninitializedMessageException(AbstractMessage.java:550) at com.symantec.AddressBookProtos$Person$Builder.build(AddressBookProtos.java:651) at com.symantec.AddressBookProtos$Person$Builder.build(AddressBookProtos.java:1) at com.symantec.ProtobufMessageBodyReader.readFrom(ProtobufMessageBodyReader.java:36) ... 39 more
For debugging purposes, I also serialized the same buffer in java and I realized that there is a small difference between the bytes serialized by ruby and the bytes serialized by java. The ruby generated bytes have an additional byte (2D) at the beginning and the rest is the same. Could this be the cause of the failure during deserialization?