You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ava.lang.IllegalArgumentException: Type mismatch. @Protobuf required type 'Integer' but field type is 'short' of field name 'direction' on class com.baidu.bjf.remoting.protobuf.simplestring.StringTypePOJOClass
at com.baidu.bjf.remoting.protobuf.code.AbstractCodeGenerator.checkType(AbstractCodeGenerator.java:332)
at com.baidu.bjf.remoting.protobuf.code.TemplateCodeGenerator.initEncodeMethodTemplateVariable(TemplateCodeGenerator.java:155)
at com.baidu.bjf.remoting.protobuf.code.TemplateCodeGenerator.getCode(TemplateCodeGenerator.java:131)
at com.baidu.bjf.remoting.protobuf.ProtobufProxy.doCreate(ProtobufProxy.java:236)
at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:174)
at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:155)
at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:128)
at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:116)
at com.baidu.bjf.remoting.protobuf.Any.pack(Any.java:127)
at com.baidu.bjf.remoting.protobuf.Any.pack(Any.java:149)
at com.baidu.bjf.remoting.protobuf.v3.any.AnyTest.encodeOriginDecodeJprotobuf(AnyTest.java:90)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
我看jprotobuf生成的idl校验是允许short,但实际检测类型的时候是通不过的。
尝试
是否有什么途径可以小数值类型往上一级的数值类型进行兼容。
The text was updated successfully, but these errors were encountered:
感谢
感谢作者提供如此优秀的组件😘。
short的无法进行创建proto代理
例如我java类声明的某个属性direction short,这种在经过proto转换是无法进行转换,会抛异常,之所以这里使用的short,是由于我一套pojo实体用到里所有地方,外部通讯解析时,这个字段固定了2个字节,打解包的时候不用再判断数值长度,而库字段也固定了smallint类型,在想仍然使用一套实体的情况下能否实现。
我看jprotobuf生成的idl校验是允许short,但实际检测类型的时候是通不过的。
尝试
是否有什么途径可以小数值类型往上一级的数值类型进行兼容。
The text was updated successfully, but these errors were encountered: