Jenkins Jmeter插件-非GUID驱动器异常错误

pkln4tw6  于 2022-11-09  发布在  Jenkins
关注(0)|答案(5)|浏览(185)

我设置了一个Jenkins作业来运行一个使用JMeter GUI构建的Jmeter测试,但是构建总是失败,并报告了一个NonGUIDriver java.lang.NullPointerException。
这是JMeter.log文件中显示的内容:

2013/07/22 10:28:16 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/HTTPSamplerProxy
line number         : 91
------------------------------- : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/HTTPSamplerProxy
line number         : 91
-------------------------------
message             : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
---- Debugging information ----
message             : HTTPSamplerProxy : HTTPSamplerProxy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy
class               : org.apache.jorphan.collections.ListedHashTree
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/HTTPSamplerProxy
line number         : 91
-------------------------------
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy : HTTPSamplerProxy
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:81)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jorphan.collections.ListedHashTree
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/hashTree[3]/HTTPSamplerProxy
line number         : 91
------------------------------- 
2013/07/22 10:28:16 ERROR - jmeter.JMeter:  java.lang.NullPointerException
    at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:91)
    at org.apache.jmeter.JMeter.runNonGui(JMeter.java:724)
    at org.apache.jmeter.JMeter.startNonGui(JMeter.java:702)
    at org.apache.jmeter.JMeter.start(JMeter.java:353)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.jmeter.NewDriver.main(NewDriver.java:207)
qgzx9mmu

qgzx9mmu1#

经过太多的搜索,我在github中找到了this thread
从本质上讲,为了使项目成功构建,我所要做的就是在.jmx测试文件中搜索并将HTTPSamplerProxy替换为HTTPSampler,现在jenkins项目的构建非常顺利。

tpgth1q7

tpgth1q72#

我遇到了同样的问题。问题是远程服务器上的Jmeter版本是2.6,而创建.jmx文件的版本是2.8。因此,我安装了一个较低的版本,并重新创建了移动到远程服务器上的.jmx文件,一切正常😀

e0bqpujr

e0bqpujr3#

我解决了这个问题,请参考下面的截图。
enter image description here

ecr0jaav

ecr0jaav4#

在我的例子中,从JMX中删除<ResultCollector>解决了这个问题。JMX在jmeter 3.1中创建,在jmeter 2.11下运行JMX。

kadbb459

kadbb4595#

我在jmeter-maven-plugin 2.9.0下运行jmeter 4.0时也遇到了同样的问题。在运行测试之前运行mvn clean可以解决这个问题。

相关问题