Issue
I have a Jenkins job set up to run a Jmeter test that was built using the JMeter GUI, but the build always fails, reporting a NonGUIDriver java.lang.NullPointerException.
This is what's shown in the JMeter.log file:
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)
Solution
After far too much hunting about, I found this thread in github.
Essentially, to make the project build successfully, all I had to do was search-and-replace the HTTPSamplerProxy
with HTTPSampler
in the .jmx test file, and the jenkins project now builds without a hitch. Joy!
Answered By - StackExchange What The Heck
Answer Checked By - Pedro (JavaFixing Volunteer)