从Jenkins shell运行Jmeter时出现异常

vbkedwbf  于 2022-11-09  发布在  Jenkins
关注(0)|答案(2)|浏览(196)

当从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
gmxoilav

gmxoilav1#

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

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

v1l68za4

v1l68za42#

在遇到同样的问题并且无法通过通常建议的解决方案(安装plugins-manager.jar)来解决它之后,我能够通过在我的机器上重新安装JMeter来修复这个问题。

相关问题