no String-argument constructor/factory method to deserialize from String value ||MismatchedInputExce

错误信息:

JSON parse error: Cannot construct instance of com.xxx.freight.waybill.api.Ao.PassengerPayNotifyAo (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (’{“userId”:333,“businessType”:20,“payChannelType”:5,“orderId”:“101200440303471”,“payType”:11,“orderPrice”:1,“tradeNo”:“20201110022015281”,“outTradeNo”:“20201110022015281”,“appId”:“jdjr111436355003”,“buyerLogonId”:“111436355003”,“payTime”:“2020-11-10 15:55:44”,“sign”:“73199e05d6aa35e22f6a05acb8c83102”}’); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of com.xxx.freight.waybill.api.Ao.PassengerPayNotifyAo (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value (’{“userId”:333,“businessType”:20,“payChannelType”:5,“orderId”:“101200440303471”,“payType”:11,“orderPrice”:1,“tradeNo”:“20201110022015281”,“outTradeNo”:“20201110022015281”,“appId”:“jdjr111436355003”,“buyerLogonId”:“111436355003”,“payTime”:“2020-11-10 15:55:44”,“sign”:“73199e05d6aa35e22f6a05acb8c83102”}’)

问题原因:
调用端(前端或其他端),转了两次json。最后使数据变成了string而非json string导致的。

解决方法:如果自己postman进行post json 是可以的话 那就调用端处理就可以了。不过大概率是调用端处理 因为这是数据问题,不是自己写的代码问题

你可能感兴趣的:(【报错收集】,java)