1

我设置了一个 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)
4

4 回答 4

3

经过太多的搜索,我在 github 中找到了这个线程。

本质上,为了使项目构建成功,我所要做的就是在 .jmx 测试文件中搜索并替换为HTTPSamplerProxyHTTPSamplerjenkins 项目现在可以顺利构建。喜悦!

于 2013-07-22T09:34:18.980 回答
2

我遇到过同样的问题。问题是远程服务器上的 Jmeter 版本是 2.6,而创建 .jmx 文件的版本是 2.8。所以我安装了一个较低版本并重新创建了移动到远程服务器的 .jmx 文件,一切都很好

于 2015-08-25T07:33:23.787 回答
2

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

在此处输入图像描述

于 2016-10-07T06:00:03.870 回答
0

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

于 2019-01-24T16:57:03.770 回答