zoukankan      html  css  js  c++  java
  • jmeter之Java request报错:java.lang.NoClassDefFoundError: redis/clients/jedis/Jedis

    今天在学习Jmeter的java request,请求内容是连接redis并获取其中的一个字段值。结果在运行时报如下错误:

    2018/05/24 13:08:20 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: redis/clients/jedis/Jedis
        at cn.testfan.redis.RedisJavaTest.setupTest(RedisJavaTest.java:36)
        at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:193)
        at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
        at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.Jedis
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

    报错原因:jmeter中缺少相应jar包。

    解决方法:在网上下载jedis-2.9.0.jar后将其放到jmeter的lib目录下,重启jmeter,运行成功。

  • 相关阅读:
    Less:优雅的写CSS代码
    线程池(ThreadPool)
    TiDB
    Docker实现CentOS容器SSH远程登录
    Oracle-Hints详解
    Oracle sql执行计划解析
    引擎基本服务接口API介绍
    ssh远程连接docker中linux(ubuntu/centos)
    自制操作系统
    kafka-net
  • 原文地址:https://www.cnblogs.com/zhengna/p/9082398.html
Copyright © 2011-2022 走看看