zzps commented on issue #13518: URL: https://github.com/apache/dubbo/issues/13518#issuecomment-1864032097
> > > > > 看起来是 fastjson 的问题 可以提给 fastjson 那边 > > > > > > > > > > > > 我单独用fastjson序列化和反序列化是没事的 > > > > > > > > > dubbo 在序列化和反序列化中都是指定了类型的 而且默认用的是 jsonb 不是json,你本地测试使用的是 jsonb 吗? > > >  > > > 这样子吗,可以的 > > 你不能这样去测试,应该还原 dubbo 序列化过程 [FastJson2ObjectOutput#writeObject](https://github.com/apache/dubbo/blob/3.2/dubbo-serialization/dubbo-serialization-fastjson2/src/main/java/org/apache/dubbo/common/serialize/fastjson2/FastJson2ObjectOutput.java#L104) > > ```java > Son son = new Son(); > son.setId("123"); > JSONB.toBytes(son); > > byte[] bytes = JSONB.toBytes(son, JSONWriter.Feature.WriteClassName, > JSONWriter.Feature.FieldBased, > JSONWriter.Feature.ErrorOnNoneSerializable, > JSONWriter.Feature.ReferenceDetection, > JSONWriter.Feature.WriteNulls, > JSONWriter.Feature.NotWriteDefaultValue, > JSONWriter.Feature.NotWriteHashMapArrayListClassName, > JSONWriter.Feature.WriteNameAsSymbol); > ``` 去掉 JSONWriter.Feature.WriteClassName 这个特性就不报错了 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
