使用beanshell操作redis直接报错


2024-09-06 15:05:02 INFO 19823970 1-1 Thread started: 19823970 1-1
2024-09-06 15:05:02 ERROR 19823970 1-1 Problem in JSR223 script, JSR223PostProcessor
Sourced file: inline evaluation of: import redis.clients.redis.Jedis; String ip = "XXXXXX"; int port = 30 . . . '' : Typed variable declaration : Class: Jedis not found in namespace : at Line: 6 : in file: inline evaluation of: import redis.clients.redis.Jedis; String ip = “XXXXXX”; int port = 30 . . . ‘’ : Jedis
in inline evaluation of: ``import redis.clients.redis.Jedis; String ip = “XXXXXX”; int port = 30 . . . ‘’ at line number 6
javax.script.ScriptException
at bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:93)
at bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46)
at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:231)
at org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:237)
at org.apache.jmeter.extractor.JSR223PostProcessor.process(JSR223PostProcessor.java:45)
at org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.java:991)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:605)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:502)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:265)
at java.base/java.lang.Thread.run(Thread.java:840)

缺少依赖包,进入项目设置-文件管理,上传jdeis相关的jar包