一次 JMeter 脚本请求错误 Could not read JSON: Unexpected character : expected a valid value 的解决笔记
来源:互联网 发布:mathematica 11 mac 编辑:程序博客网 时间:2024/04/28 21:59
用 Badboy 录制的脚本,有个界面是 Ajax 提交表单,先有 HTTP Status 415 错误(解决方案参考《一次 JMeter 脚本请求错误 HTTP Status 415 的解决笔记》),然后又有 Could not read JSON: Unexpected character ('%' (code 37)): expected a valid value 错误。监听器 "察看结果树" 可以看到服务器响应数据如下:
{"status":0,"data":"Could not read JSON: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@172fa261; line: 1, column: 2]; nested exception is org.codehaus.jackson.JsonParseException: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@172fa261; line: 1, column: 2]"}
该次 http 请求如下图所示:
另外监听器捕捉到该次请求如下所示:
POST http://xxx.com/merServPlat/proc/modifySubmit.json
POST data:
%7B%22stageId%22%3A276%2C%22modifyTime%22%3Anull%2C%22merId%22%3A276%2C%22merCode%22%3A%22000100015200001%22%2C...
POST data 里只有这些。这些明显是一个 json 串,只不过 JMeter 竟然把 json 串转义后再提交了。
修改该次 HTTP 请求的 Body Data,把要提交的 json 串考进去,保存,重新运行测试,问题解决。
{"status":0,"data":"Could not read JSON: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@172fa261; line: 1, column: 2]; nested exception is org.codehaus.jackson.JsonParseException: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@172fa261; line: 1, column: 2]"}
该次 http 请求如下图所示:
另外监听器捕捉到该次请求如下所示:
POST http://xxx.com/merServPlat/proc/modifySubmit.json
POST data:
%7B%22stageId%22%3A276%2C%22modifyTime%22%3Anull%2C%22merId%22%3A276%2C%22merCode%22%3A%22000100015200001%22%2C...
POST data 里只有这些。这些明显是一个 json 串,只不过 JMeter 竟然把 json 串转义后再提交了。
修改该次 HTTP 请求的 Body Data,把要提交的 json 串考进去,保存,重新运行测试,问题解决。
0 0
- 一次 JMeter 脚本请求错误 Could not read JSON: Unexpected character : expected a valid value 的解决笔记
- Unexpected character ('<' (code 60)): expected a valid value ...
- flume nginx 日志处理异常 JsonParseException: Unexpected character ('(' (code 40)): expected a valid value
- JsonParseException: Unexpected character ('' (code 65279 / 0xfeff)): expected a valid value
- 一次 JMeter 脚本请求错误 HTTP Status 415 的解决笔记
- 解决 liblog4cpp.a: could not read symbols: Bad value
- org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid valu
- TTserver 编译/usr/local/lib/libbz2.a: could not read symbols: Bad value解决
- make error: libneon.a: could not read symbols: Bad value
- lib_clapack.a(dlasyf.o): could not read symbols: File in wrong format---- 交叉编译opencv2.0遇到的错误解决
- informix错误Could not do a physical-order read to fetch next row解决
- 关于SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data错误的解决
- Myeclipse的problem中出现cannot be read or is not a valid ZIP file解决
- QSqlQuery::value: not positioned on a valid record 的错误的解决方法
- archive for required library could not be read or is not a valid ZIP file
- DependencyProperty.UnsetValue}' is not a valid value for property 'Background' 的错误原因
- Expected value at 1:0 Expected value at 2:0 Expected value at xx:xx错误的解决
- Could not bind to a valid ArcGIS installation问题的解决
- BeagleBoneblack 使用心得
- 配置环境
- Android 的 Activity 组件
- QML类型说明-KeyEvent
- 哪位大神有类似qq窗口的插件代码。麻烦给点。谢谢了。
- 一次 JMeter 脚本请求错误 Could not read JSON: Unexpected character : expected a valid value 的解决笔记
- [转]Windows上64位编程
- TCP&UDP不同点
- WF-在EBS中配置Notification Mailer常见错误
- win8下cocos2d-js v3.0 环境搭配
- 利用二叉树的中序遍历和后序遍历序列构造一个二叉树Search results for Construct Binary Tree from Inorder and Postorder Traversa
- QML类型说明-KeyNavigation
- sigwait()函数
- 网络爬虫排除协议robots.txt介绍及写法详解.