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

[Bug] com.alibaba.fastjson2.JSONException: not support autotype : [String, offset 10 #14092

Open
3 of 4 tasks
390237 opened this issue Apr 16, 2024 · 3 comments
Open
3 of 4 tasks
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@390237
Copy link

390237 commented Apr 16, 2024

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo java 3,2.11 jdk1.8

Steps to reproduce this issue

When using the default fastjson2, if the interface contains a parameter that is: String[], the error is returned: com.alibaba.fastjson2.JSONException: not support autotype : [String, offset 10,
When the production side is changed to Hessian2, it can be used normally, and fastjson2 can support the String[] parameter?

当使用默认fastjson2,接口如果包含有参数是:String[],返回错误:com.alibaba.fastjson2.JSONException: not support autotype : [String, offset 10,
当将生产端改成Hessian2,就可以正常使用,可以让fastjson2支持String[]参数?

What you expected to happen

Can fastjson2 support String[]?

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@390237 390237 added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Apr 16, 2024
@heliang666s
Copy link
Contributor

这也许是fastjson的问题而不是dubbo的问题

@bert82503
Copy link

bert82503 commented Apr 22, 2024

这也许是fastjson2的问题,而不是dubbo的问题

是fastjson2的问题。

Dubbo3.2默认使用fastjson2,升级过程中遇到一些fastjson2参数序列化问题。出于安全风险考虑,最终选择退回到hessian2,升级所有核心应用到生产环境的目标才完成。
建议统一使用hessian2参数序列化,与先前保持一样,因为有很多奇葩的响应返回结构。 @390237

fastjson2当前还不是很稳定,遇到的问题不少,参数序列化的性能收益也较低。

Dubbo应用可观测性升级指南与踩坑记录
https://blog.csdn.net/shupili141005/article/details/137884052

@390237
Copy link
Author

390237 commented Apr 28, 2024

嗯,已经指定使用hessian2了,主要觉得dubbo在fastjson2还没完全稳定情况下,将默认序列化强制成fastjson2,太冒险了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Status: Todo
Development

No branches or pull requests

3 participants