I'm trying to load a jmx test plan in Java code (similar to this) using -
HashTree testPlanTree = SaveService.loadTree(new File("<path-to-jmx>"));
It works for basic test plan but, if I load a test plan using any plugin like Arrivals Thread group, it throws an exception. The plugins are installed on my local (jars are present in <JMETER_HOME>/lib/ext/) and the test plan is working fine via jmeter.
- Do we need to configure something for code to detect plugins in the test plan and prevent this error?
- Can we install plugins from the test plan directly using any api for successful loading or at least get the names of plugins used by the test plan?
Exception I get -
...Exception in thread "main" java.lang.IllegalArgumentException: Problem loading XML from:'<path-to-jmx>'.
Cause:
CannotResolveClassException: com.blazemeter.jmeter.threads.arrivals.ArrivalsThreadGroup
Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message :
first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:66)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/com.blazemeter.jmeter.threads.arrivals.ArrivalsThreadGroup
line number : 64
version : 5.3
-------------------------------
at org.apache.jmeter.save.SaveService.readTree(SaveService.java:458)
at org.apache.jmeter.save.SaveService.loadTree(SaveService.java:431)....