exception occured while trying to run jmx file through java code

时间:2016-09-01 06:12:38

标签: java jmeter

I am trying to run the jmx file through java code and got below exceptions:

INFO    2016-09-01 11:35:53.876 [jmeter.e] (): Listeners will be started after enabling running version
INFO    2016-09-01 11:35:53.896 [jmeter.e] (): To revert to the earlier behaviour, define jmeterengine.startlistenerslater=false
INFO    2016-09-01 11:35:53.899 [jmeter.u] (): Setting Locale to en_US

Exception in thread "main" java.lang.NoClassDefFoundError: com/thoughtworks/xstream/converters/ConversionException
    at com.staples.mobilautomation.JMeterFromExistingJMX.main(JMeterFromExistingJMX.java:22)
Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.converters.ConversionException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 1 more

Please help me to get closure.

2 个答案:

答案 0 :(得分:0)

You have to add com.thoughtworks.xstream_1.3.0.jar to your classpath.

答案 1 :(得分:0)

You need to add xstream jar to your program.

You can download it from here.