Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.alibaba.fastjson2.JSONException: skip not support type INT32 68 #1257

Closed
Skqing opened this issue Mar 21, 2023 · 9 comments
Closed

com.alibaba.fastjson2.JSONException: skip not support type INT32 68 #1257

Skqing opened this issue Mar 21, 2023 · 9 comments
Labels
fixed question Further information is requested
Milestone

Comments

@Skqing
Copy link

Skqing commented Mar 21, 2023

请描述您的问题

dubbo3调用时报错

异常信息

Caused by: org.apache.dubbo.remoting.RemotingException: com.alibaba.fastjson2.JSONException: skip not support type INT32 68
com.alibaba.fastjson2.JSONException: skip not support type INT32 68
        at com.alibaba.fastjson2.JSONReaderJSONB.skipValue(JSONReaderJSONB.java:2269)
        at com.alibaba.fastjson2.reader.ObjectReaderBean.processExtra(ObjectReaderBean.java:117)
        at com.alibaba.fastjson2.reader.ORG_13_15_ShopLotPlayResDTO.readJSONBObject(Unknown Source)
        at com.alibaba.fastjson2.reader.ORG_11_1_ShopLotPlayListResDTO.readJSONBObject(Unknown Source)
        at com.alibaba.fastjson2.reader.ObjectReaderImplObject.readJSONBObject(ObjectReaderImplObject.java:305)
        at com.alibaba.fastjson2.reader.ORG_7_5_BaseResDTO.readJSONBObject(Unknown Source)
        at com.alibaba.fastjson2.JSONB.parseObject(JSONB.java:519)
        at org.apache.dubbo.common.serialize.fastjson2.FastJson2ObjectInput.readObject(FastJson2ObjectInput.java:131)
        at org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.handleValue(DecodeableRpcResult.java:161)
        at org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:106)
        at org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:138)
        at org.apache.dubbo.remoting.transport.DecodeHandler.decode(DecodeHandler.java:62)
        at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:50)
        at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:62)
        at org.apache.dubbo.common.threadpool.ThreadlessExecutor$RunnableWrapper.run(ThreadlessExecutor.java:184)
        at org.apache.dubbo.common.threadpool.ThreadlessExecutor.waitAndDrain(ThreadlessExecutor.java:103)
        at org.apache.dubbo.rpc.AsyncRpcResult.get(AsyncRpcResult.java:194)
        at org.apache.dubbo.rpc.protocol.AbstractInvoker.waitForResultIfSync(AbstractInvoker.java:285)
        at org.apache.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:189)
        at org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:71)
        at org.apache.dubbo.validation.filter.ValidationFilter.invoke(ValidationFilter.java:98)
        at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
        at org.apache.dubbo.cache.filter.CacheFilter.invoke(CacheFilter.java:95)
        at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
        at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CallbackRegistrationInvoker.invoke(FilterChainBuilder.java:194)
        at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invokeWithContext(AbstractClusterInvoker.java:380)
        at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:81)
        at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:341)
        at org.apache.dubbo.rpc.cluster.router.RouterSnapshotFilter.invoke(RouterSnapshotFilter.java:46)
        at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
        at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:101)

@Skqing Skqing added the question Further information is requested label Mar 21, 2023
@wenshao
Copy link
Member

wenshao commented Mar 21, 2023

fastjson2什么版本?

@Skqing Skqing closed this as completed Mar 21, 2023
@Skqing
Copy link
Author

Skqing commented Nov 22, 2023

改了DTO里的值,需要在类里面加上 private static final long serialVersionUID = -7403699734166902222L;

@bert82503
Copy link

bert82503 commented Jan 29, 2024

温少,我们升级到dubbo-3.2.10fastjson2-2.0.43,还有遇到这个问题。
麻烦帮忙再看下,感谢 @wenshao

我们排查到的一些信息与线索,消费者和提供者使用的响应结构有一些差异,JSONB协议通过字段类型和顺序进行了数据空间压缩,丢失字段名称,会带来对象字段签名问题(与方法参数列表签名类似),不能随意在中间任意位置增加新的字段。新的字段,需要添加在对象末尾。
不知道我这样理解,对不对?

org.apache.dubbo.common.serialize.SerializationException: com.alibaba.fastjson2.JSONException: skip not support type INT32 68
    ... 153 more
Caused by: com.alibaba.fastjson2.JSONException: skip not support type INT32 68
    at com.alibaba.fastjson2.JSONReaderJSONB.skipValue(JSONReaderJSONB.java:2461)
    at com.alibaba.fastjson2.reader.ObjectReaderBean.processExtra(ObjectReaderBean.java:129)
    at com.alibaba.fastjson2.reader.ORG_6_31_StoreFrontSimpleResponse.readJSONBObject(Unknown Source)
    at com.alibaba.fastjson2.reader.ObjectReaderImplObject.readJSONBObject(ObjectReaderImplObject.java:319)
    at com.alibaba.fastjson2.reader.ORG_5_4_CommonResponse.readJSONBObject(Unknown Source)
    at com.alibaba.fastjson2.JSONB.parseObject(JSONB.java:540)
    at org.apache.dubbo.common.serialize.fastjson2.FastJson2ObjectInput.readObject(FastJson2ObjectInput.java:171)
    at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectInput.readObject(DefaultSerializationExceptionWrapper.java:170

@wenshao wenshao added this to the 2.0.46 milestone Jan 29, 2024
@wenshao wenshao reopened this Jan 29, 2024
@wenshao
Copy link
Member

wenshao commented Jan 29, 2024

@bert82503 不影响的,你遇到的问题是忽略不存在的字段有BUG,我这两天发布一个版本修复掉就好了。

@bert82503
Copy link

bert82503 commented Jan 29, 2024

👍 好的,感谢解惑 @wenshao

@bert82503
Copy link

bert82503 commented Jan 29, 2024

温少,我的理解,skip not support type INT32 69 与68是类似的问题。
需要提供CommonResponse结构定义么? @wenshao

org.apache.dubbo.common.serialize.SerializationException: com.alibaba.fastjson2.JSONException: skip not support type INT32 69
    ... 153 more
Caused by: com.alibaba.fastjson2.JSONException: skip not support type INT32 69
    at com.alibaba.fastjson2.JSONReaderJSONB.skipValue(JSONReaderJSONB.java:2461)
    at com.alibaba.fastjson2.reader.ObjectReaderBean.processExtra(ObjectReaderBean.java:129)
    at com.alibaba.fastjson2.reader.ORG_6_31_StoreFrontSimpleResponse.readJSONBObject(Unknown Source)
    at com.alibaba.fastjson2.reader.ObjectReaderImplObject.readJSONBObject(ObjectReaderImplObject.java:319)
    at com.alibaba.fastjson2.reader.ORG_5_4_CommonResponse.readJSONBObject(Unknown Source)
    at com.alibaba.fastjson2.JSONB.parseObject(JSONB.java:540)
    at org.apache.dubbo.common.serialize.fastjson2.FastJson2ObjectInput.readObject(FastJson2ObjectInput.java:171)
    at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectInput.readObject(DefaultSerializationExceptionWrapper.java:170

@wenshao
Copy link
Member

wenshao commented Jan 29, 2024

@bert82503 不需要,问题已经修复,等发版本

@wenshao
Copy link
Member

wenshao commented Jan 29, 2024

https://github.com/alibaba/fastjson2/releases/tag/2.0.46
问题已修复,请用新版本

@wenshao wenshao closed this as completed Jan 29, 2024
@bert82503
Copy link

bert82503 commented Jan 29, 2024

https://github.com/alibaba/fastjson2/releases/tag/2.0.46 问题已修复,请用新版本

看了JSONReaderJSONB.skipValue()default:这块实现逻辑,BC_INT32_*_MINBC_INT64_*_MINBC_INT32_SHORT_MIN

  • BC_INT64_NUM_MIN、BC_INT64_NUM_MAX,BC_INT64_BYTE_MIN、BC_INT64_BYTE_MAX,BC_INT64_SHORT_MIN、BC_INT64_SHORT_MAX
  • BC_INT32_NUM_MIN、BC_INT32_NUM_MAX,BC_INT32_BYTE_MIN、BC_INT32_BYTE_MAX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants