从Jenkins shell运行Jmeter时出现com.thoughtworks.xstream.converters.ConversionException

时间:2015-10-22 17:11:47

标签: jmeter

从Jenkins命令行运行Jmeter jmx脚本时,我收到以下错误。

Error in NonGUIDriver java.lang.IllegalArgumentException:
    Problem loading XML from:'/Users/msn/apache-jmeter-2.13/bin/testMsn.jmx',
    conversion error com.thoughtworks.xstream.converters.ConversionException:
    org/apache/commons/lang3/CharUtils : org/apache/commons/lang3/CharUtils

我的所有插件都安装在我的Jmeter / lib / ext。

有人可以帮我指出哪个jar丢失来解决这个问题

 Building in workspace /Users/Shared/Jenkins/Home/jobs/Jmeter-First/workspace
   [workspace] $ /bin/sh -xe   /Users/Shared/Jenkins/tmp/hudson6757313439371769855.sh
   + /Users/msn/apache-jmeter-2.13/bin/jmeter.sh -n -t /Users/msn/apache-jmeter-  2.13/bin/TestPlan.jmx
   Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML   from:'/Users/msn/apache-jmeter-2.13/bin/TestPlan.jmx', conversion error    com.thoughtworks.xstream.converters.ConversionException:   org/apache/commons/lang3/CharUtils : org/apache/commons/lang3/CharUtils
   ---- Debugging information ----
   message             : org/apache/commons/lang3/CharUtils
   cause-exception     : java.lang.NoClassDefFoundError
   cause-message       : org/apache/commons/lang3/CharUtils
   first-jmeter-class  : org.apache.jmeter.samplers.SampleSaveConfiguration.  <clinit>(SampleSaveConfiguration.java:323)
   class               : org.apache.jmeter.save.ScriptWrapper
   required-type       : org.apache.jmeter.reporters.ResultCollector
   converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
   path                :   /jmeterTestPlan/hashTree/hashTree/hashTree/ResultCollector
   line number         : 46
   version             : 2.13 r1665067
   ------------------------------
 Finished: SUCCESS

2 个答案:

答案 0 :(得分:0)

lang3.CharUtils 是Apache Commons Lang库(http://mvnrepository.com/artifact/org.apache.commons/commons-lang3)的一部分。因此,请确保它在类路径中可用(例如 commons-lang3-3.3.2.jar )。

另外,请确保您不要将它与Commons Lang库(http://mvnrepository.com/artifact/commons-lang/commons-lang)混淆,后者是前面提到的Apache Commons Lang的前身。例如 commons-lang-2.4.jar

答案 1 :(得分:0)

遇到相同的问题并且无法通过通常建议的解决方案(安装plugins-manager.jar)解决之后,我能够通过在计算机上重新安装JMeter来解决此问题。