protocol buffer使用中的问题This is supposed to be overridden by subclasses
2015-04-13 17:53
537 查看
测试protocol buffer格式数据输出工具类。用了protoc-2.4.1-win32生成的java类。然后测试项目中引入的包是
执行测试类的时候报下面的错误
后来发现是版本不一致的问题造成的,然后重新用protoc-2.5.0-win32根据.proto文件重新生成java文件,然后重新运行测试代码果然解决了问题
如下图
<dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>2.5.0</version> </dependency
执行测试类的时候报下面的错误
Exception in thread "main" java.lang.UnsupportedOperationException: This is supposed to be overridden by subclasses. at com.google.protobuf.GeneratedMessage.getUnknownFields(GeneratedMessage.java:180) at com.test.utill.TextFormat$Printer.print(TextFormat.java:251) at com.test.utill.MessageLiteToStringUtil.toString(MessageLiteToStringUtil.java:20) at com.test.protocol.ProtocolTest.main(ProtocolTest.java:23)
后来发现是版本不一致的问题造成的,然后重新用protoc-2.5.0-win32根据.proto文件重新生成java文件,然后重新运行测试代码果然解决了问题
如下图
相关文章推荐
- protocol buffer使用中的问题This is supposed to be overridden by subclasses
- protocol buffer使用中的问题This is supposed to be overridden by subclasses
- 溯源 Uses CGLIB to generate subclasses dynamically if methods need to be overridden by the container
- webservice+ejb3+jboss4.2.3问题:setProperty must be overridden by all subclasses of SOAPMessage
- setProperty must be overridden by all subclasses of SOAPMessage 解决办法
- jboss在jdk下webservice报setProperty must be overridden by all subclasses of SOAPMessage
- Jboss SpringMVC调用WebService报错:setProperty must be overridden by all subclasses of SOAPMessage
- UnsupportedOperationException:setProperty must be overridden by all subclasses of SOAPMessage解决方法>有效
- 使用GPS提示的问题是Call requires permission which may be rejected by user: code should explicitly check to s
- UnsupportedOperationException:setProperty must be overridden by all subclasses of SOAPMessage解决方...
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
- Git 使用中显示“Another git process seems to be running in this repository...”的提示问题解决办法
- Git 使用中显示“Another git process seems to be running in this repository...”问题解决
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
- 问题-Ctrl+F7跟踪值时提示“Function to be called, TGGLPolyhedron3d.AsString, was eliminated by linker”
- 解决spring使用动态代理类型转换失败的问题--java.lang.ClassCastException: com.sun.proxy.$Proxy$ cannot be cast to ...今天
- 使用webservlert注解时出现WebServlet cannot be resolved to a type的问题
- centos中使用tree和you need to be root to this command问题
- Expected one result (or null) to be returned by selectOne(), but found: 2问题完美解决
- Git 使用中显示“Another git process seems to be running in this repository...”问题解决