RayTigerZ commented on issue #3539: URL: https://github.com/apache/servicecomb-java-chassis/issues/3539#issuecomment-1364485677
> > 发现在依赖的sdk包中存在ProduceProcessor的SPI配置 FastJsonProduceProcessor StringProduceProcessor org.apache.servicecomb.common.rest.codec.produce.ProduceJsonProcessor org.apache.servicecomb.common.rest.codec.produce.ProduceTextPlainProcessor 前两个可以进行配置关闭,后两个还是会起作用,继而出现异常 java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.alibaba.fastjson.JSONObject > > 估计你的咨询下你们项目这块的背景。FastJsonProduceProcessor 应该就是处理你说的场景的。 java chassis默认情况下并不支持JsonObject,也不建议这么使用。 详细说明参考: https://servicecomb.apache.org/references/java-chassis/zh_CN/build-provider/interface-constraints.html 跟我们项目没啥关系,我们直接被平台挖的坑绊倒了。我跟完代码后,也慢慢理解为啥他为啥怎么做了:从JavaType responseType = invocation.findResponseType(responseEx.getStatus());获取到responseType大部分都是Object.class,ProduceJsonProcessor转化之后就是个Map,自已搞个FastJsonProduceProcessor 转换成JSONObject(提供了get().asXXX()),好像是比Map取值强转好多l -- 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]
