Я пытаюсь выполнить тест JMeter, который следующая команда.
https://www.blazemeter.com/blog/5-ways-launch-jmeter-test-without-using-jmeter-gui
public static void main(String[] argv) throws Exception {
// JMeter Engine
StandardJMeterEngine jmeter = new StandardJMeterEngine();
// Initialize Properties, logging, locale, etc.
JMeterUtils.loadJMeterProperties("/work/apache-jmeter-5.0/bin/jmeter.properties");
JMeterUtils.setJMeterHome("/work/apache-jmeter-5.0");
//JMeterUtils.initLogging();// you can comment this line out to see extra log messages of i.e. DEBUG level
JMeterUtils.initLocale();
// Initialize JMeter SaveService
SaveService.loadProperties();
// Load existing .jmx Test Plan
File in = new File("/work/apache-jmeter-5.0/extras/jmeter_test.jmx");
HashTree testPlanTree = SaveService.loadTree(in);
//in.close();
// Run JMeter Test
jmeter.configure(testPlanTree);
jmeter.run();
}
Но я всегда получаю ошибку
Причина: com.thoughtworks.xstream.converters.ConversionException
Не могли бы вы помочь мне!
А ниже подробно ошибка:
Exception in thread "main" java.lang.IllegalArgumentException: Problem loading XML from:'/work/apache-jmeter-5.0/extras/jmeter_test.jmx'.
Cause:
CannotResolveClassException: org.apache.jmeter.protocol.http.control.CookieManager
cause-exception :
at org.apache.jmeter.save.ScriptWrapperConverter.createConversionException(ScriptWrapperConverter.java:102)
at org.apache.jmeter.save.ScriptWrapperConverter.unmarshal(ScriptWrapperConverter.java:96)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1486)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1466)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1337)
at org.apache.jmeter.save.SaveService.readTree(SaveService.java:452)