Jenkins Jmeter插件 - NonGUIDriver java.lang.NullPointerException

时间:2013-07-22 09:34:19

标签: jenkins jmeter

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

3 个答案:

答案 0 :(得分:3)

经过太多的狩猎,我在github中找到了this thread

基本上,为了使项目成功构建,我所要做的就是在.jmx测试文件中用HTTPSamplerProxy搜索并替换HTTPSampler,而jenkins项目现在不需要拴住。快乐!

答案 1 :(得分:0)

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

enter image description here

答案 2 :(得分:0)

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