As Marc said, A mismatch in Protocol Buffer versions will give you this exact message. In particular if
- The .proto definition is converted to java using the 2.4.3 (or earlier) protoc.exe
- You use the 2.5.0 protobuffers library
you will get this message in many methods (e.g. getParserForType, getUnknownFields) of class GeneratedMessage. There are no doubt other potential mismatch's that will cause this error
With protocol buffers 2.5.0 it is essential you regenerate all java classes with the 2.5.0 version of protoc (or on windows protoc.exe).
If you do the reverse - run code generated by protoc version 2.5 with the libraries for protocol buffers version 2.4. You will get the following message
java.lang.VerifyError: class xxx.xxx.xx..
overrides final method getUnknownFields.()Lcom/google/protobuf/UnknownFieldSet;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…