在JME中遇到org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: 问题的解决方法

 

今天根据开发需求,需要在发布后台中创建一个书本,专栏中每本书的章节数需要200个左右,于是我想到了使用Jmeter工具帮助我完成这一任务,可是在实践过程中遇到了很多问题,后来解决了这些问题,因此,记录下这些问题从何而来,如何解决,希望以后不要再犯这种错误~

报错1:

org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unrecognized token 'isListAll': was expecting ('true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'isListAll': was expecting ('true', 'false' or 'null')

报错2:

org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('-' (code 45)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('-' (code 45)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value

报错3:

org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true','false' or 'null')

错误原因:

经过百度翻译和在网上查询,问题定位为JSON解析错误,也就是在Http请求中写的参数有问题或者参数在脚本执行时转换有问题

解决方案:

将原来“参数”格式修改为“消息体数据”,如下所示:

1、将接口中POST请求中的Request Payload参数使用 view source模式打开,并在view source模式下的内容

将复制的内容,填入“消息体数据”底下的空白格中,即可解决这个问题~

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值