Apache JMeter 异常 NoSuchMethodError

Apache JMeter exception NoSuchMethodError

我正在尝试 运行 对使用 JMeter 记录的某些事务进行负载测试,但是在执行时显示以下错误

Exception in thread "HomePage_thread 10-2" java.lang.NoSuchMethodError: 'void org.apache.commons.io.IOUtils.closeQuietly(java.io.Closeable, java.util.function.Consumer)' at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1982) at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:476) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:673) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285) at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) at java.base/java.lang.Thread.run(Thread.java:832)

知道问题出在哪里吗?

您的设置至少需要 commons-io-2.7.jar 可用

public static void closeQuietly(Closeable closeable, Consumer consumer)

Since: 2.7

删除此 jar 的旧版本(如果存在)

经典Jar Hell

  1. Deeplearning4j depends on commons-io 2.5
  2. JMeter HTTP 组件depends on commons-io 2.8

您需要修改您的项目类路径以便仅包含 commons-io 2.8 以使 JMeter 正常工作或降级到依赖于 commons-io 2.5

JMeter 3.1