开发者

Protobuf deserializing works on one dev machine but not another

开发者 https://www.devze.com 2023-02-09 03:43 出处:网络
I develop a C# application for the company I work for. Some data objects are serialized using protocol buffers. I am now working on deserializing these objects in a Java application the company also d

I develop a C# application for the company I work for. Some data objects are serialized using protocol buffers. I am now working on deserializing these objects in a Java application the company also develops. On my dev machine everything works. However if I try to run my test project on a different machine things fail. Some members are not being populated with values.

Is there some Protobuf dependency that I'm not aware of? I am getting the Protobuf.jar file by compiling the 2.3.0 source.

I can send my test project if needed.

Edit:

Not sure what I did but my test project is now working. However, when I add the files to the application's project I get "com.google.protobuf.InvalidProtocolBufferException: Protocol message tag had invalid wire type."

What could possibly be different that would cause this exception?

Resolve:

The file I was trying to deserialize got corrupted when I copied it into the main projects unit test. All开发者_运维技巧 I had to do was delete the file and replace it with the version I knew was working. SUCCESS!

0

精彩评论

暂无评论...
验证码 换一张
取 消