简体   繁体   中英

Apache JMeter exception NoSuchMethodError

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.ZB6EFD606D118D 0F62066E31419FF04CCZ.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.ZCFCB9E362BAFF27C8 AE58C326D070C4EZ.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?

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM