Apache JMeter exception NoSuchMethodError

2k Views Asked by At

I'm trying to run load testing on some transactions recorded with JMeter however when executing it shows the error below

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)

Any idea what can be the problem?

3

There are 3 best solutions below

1
Dmitri T On BEST ANSWER

Classic Jar Hell

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

You need to amend your project classpath in order to include only commons-io 2.8 in order to get JMeter working or downgrade to JMeter 3.1 which relies on commons-io 2.5

2
Ori Marko On

Your settings requires at least commons-io-2.7.jar to be available

public static void closeQuietly(Closeable closeable, Consumer consumer)

Since: 2.7

Delete old versions of this jar if exists

0
TTDS On

I had to face this same issue when trying to run my first Jmeter test plan.

  • Jmeter version I use - v5.4.3
  • commons.io jar version I had - 2.6 & 2.8

What I have done is simply delete both commons.io jar files (above mentioned) from the (->lib). Then I downloaded the latest commons.io jar version (2.11) to the above path. Now I was able to run the test plan without getting this issue.