Caused by: java.lang.IllegalArgumentException: [Serialization Security] Serialized class cn.demo.vo.testDto is not in allow list. Current mode is `STRICT`, will disallow to deserialize it by default. Please add it into security/serialize.allowlist or follow FAQ to configure it.
at org.apache.dubbo.common.serialize.fastjson2.Fastjson2SecurityManager$Handler.apply(Fastjson2SecurityManager.java:143)
at com.alibaba.fastjson2.JSONReaderJSONB.readAny(JSONReaderJSONB.java:733)
at com.alibaba.fastjson2.JSONReaderJSONB.readAny(JSONReaderJSONB.java:930)
at com.alibaba.fastjson2.reader.ObjectReaderImplObject.readJSONBObject(ObjectReaderImplObject.java:328)
at com.alibaba.fastjson2.reader.ORG_1_6_DataReturn.readJSONBObject(Unknown Source)
at com.alibaba.fastjson2.JSONB.parseObject(JSONB.java:540)
出现这种问题解决办法就是在 resource 下新建一个文件夹security 然后在 security 文件夹下新建 serialize.allowlist文件如resource/security/serialize.allowlist
在serialize.allowlist写入允许的类的全路径 例如cn.demo.vo.testDto
实测通过