jmeter使用beanshell报错Typed variable declaration : Class: JSONObject not found in namespace
2020-07-31 12:07
966 查看
【问题描述】
jmeter使用beanshell断言报错:
2020-07-31 11:56:49,536 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of:
import org.json.*; String response = prev.getResponseDataAsString(); JSONObje . . . '' : Typed variable declaration : Class: JSONObject not found in namespace 2020-07-31 11:56:49,536 WARN o.a.j.a.BeanShellAssertion: Error in BeanShellAssertion org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of:import org.json.*; String response = prev.getResponseDataAsString(); JSONObje . . . ‘’ : Typed variable declaration : Class: JSONObject not found in namespace
at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:180) ~[ApacheJMeter_core.jar:5.2.1]
【问题分析】
需要json.jar包
【解决方案】
1、下载json.jar包放到jmeter的lib目录下
2、重启jmeter
【验证】
再次执行OK,不需要在测试计划中引入json.jar包
相关文章推荐
- Jmeter not found in class'org.json.JSONObject 问题
- 使用JSONObject报错:Java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeEx
- Spring MVC 解决 Could not write JSON: No serializer found for class java.lang.Object
- @RequestParam注解使用:Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
- 使用JSON报的一个错误java.lang.ClassNotFoundException
- Sqoop import导入表时报错java.lang.ClassNotFoundException: org.json.JSONObject
- 使用JSON报的一个错误java.lang.ClassNotFoundException
- php使用ZipArchive提示Fatal error: Class ZipArchive not found in的解决方法
- 使用JSON报的一个错误java.lang.ClassNotFoundException
- 调试程序JSONObject对象转换时出现:java.lang.ClassNotFoundException:
- 使用JSON报的一个错误java.lang.ClassNotFoundException
- Caused by: java.lang.ClassNotFoundException: net.sf.json.JSONObject
- 服务器使用json时报错java.lang.ClassNotFoundException: org.json.JSONException
- Android JSON 出现Caused by: java.lang.ClassNotFoundException: net.sf.json.JSONObject;
- php使用ZipArchive提示Fatal error: Class ZipArchive not found in的解决方法
- Caused by: java.lang.ClassNotFoundException: com.alibaba.fastjson.JSONObject
- 使用IDEA时遇到问题:Exception in thread "main" java.lang.ClassNotFoundException:
- 【Exception】java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClass
- [BTS] Loading property information list by namespace failed or property not found in the list. Verify that the schema is deployed properly.
- Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor