Error while extracting response for type[接收的response实体类] and content type [application/json;charset=

Error while extracting response for type[接收的response实体类] and content type [application/json;charset=UTF-8];.........JSON parse error:Connot construct instance of ‘接受收的实体类responseDTO’ (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value(‘fail’);.........

!!!这个错误是因为Json转换成对象失败了,虽然responseDTO有一个构造器,但默认的是无参构造器,此时没办法解析服务端传来的单个字符串。

!!!原因是responseDTO里边缺少了一个只有一个String类型参数的构造器,导致在解析 ’fail’的时候失败了,需要在responseDTO里边创建一个构造方法,来接收字符串:‘fail’

例: public responseDTO(String args1){  //args1参数名任意取

this.args1=args1;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值