Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the same module name in command line mode causes NPE #2233

Closed
asfimport opened this issue May 7, 2009 · 2 comments
Closed

Using the same module name in command line mode causes NPE #2233

asfimport opened this issue May 7, 2009 · 2 comments

Comments

@asfimport
Copy link
Collaborator

Deepak Shetty (Bug 47165):
If the test includes Module Controllers having the same name and the Test is run on the command line , the test fails with a
[jmeter] Uncaught Exception java.lang.NullPointerException. See log file for details.

The Log
2009/05/07 09:31:48 ERROR - jmeter.engine.StandardJMeterEngine: Uncaught exception: java.lang.NullPointerException
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:976)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:976)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:976)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:959)
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:337)
at java.lang.Thread.run(Thread.java:595)

Note this doesn't happen when running in GUI mode. This does not happen if the Module Controller is named differently.

Created attachment JmeterSameModuleControllerNameBug.jmx: Sample script to simulate the problem

JmeterSameModuleControllerNameBug.jmx
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Evolution Test Plan" enabled="true">
      <stringProp name="TestPlan.comments">Evolution Test Plan</stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
        <boolProp name="ResultCollector.error_logging">false</boolProp>
        <objProp>
          <name>saveConfig</name>
          <value class="SampleSaveConfiguration">
            <time>true</time>
            <latency>true</latency>
            <timestamp>true</timestamp>
            <success>true</success>
            <label>true</label>
            <code>true</code>
            <message>true</message>
            <threadName>true</threadName>
            <dataType>true</dataType>
            <encoding>false</encoding>
            <assertions>true</assertions>
            <subresults>true</subresults>
            <responseData>false</responseData>
            <samplerData>false</samplerData>
            <xml>true</xml>
            <fieldNames>false</fieldNames>
            <responseHeaders>false</responseHeaders>
            <requestHeaders>false</requestHeaders>
            <responseDataOnError>false</responseDataOnError>
            <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
            <assertionsResultsToSave>0</assertionsResultsToSave>
            <bytes>true</bytes>
          </value>
        </objProp>
        <stringProp name="filename"></stringProp>
      </ResultCollector>
      <hashTree/>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Defects" enabled="true">
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">1</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1237914476000</longProp>
        <longProp name="ThreadGroup.end_time">1237914476000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Transaction Controller" enabled="true">
          <boolProp name="TransactionController.parent">false</boolProp>
        </TransactionController>
        <hashTree>
          <ModuleController guiclass="ModuleControllerGui" testclass="ModuleController" testname="Test" enabled="true">
            <collectionProp name="ModuleController.node_path">
              <stringProp name="-1227702913">WorkBench</stringProp>
              <stringProp name="1911325554">Evolution Test Plan</stringProp>
              <stringProp name="-1402880153">Modules</stringProp>
              <stringProp name="2603186">Test</stringProp>
            </collectionProp>
          </ModuleController>
          <hashTree/>
          <ModuleController guiclass="ModuleControllerGui" testclass="ModuleController" testname="Test" enabled="true">
            <collectionProp name="ModuleController.node_path">
              <stringProp name="-1227702913">WorkBench</stringProp>
              <stringProp name="1911325554">Evolution Test Plan</stringProp>
              <stringProp name="-1402880153">Modules</stringProp>
              <stringProp name="2603186">Test</stringProp>
            </collectionProp>
          </ModuleController>
          <hashTree/>
        </hashTree>
      </hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Modules" enabled="false">
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">1</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1240415054000</longProp>
        <longProp name="ThreadGroup.end_time">1240415054000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Test" enabled="true"/>
        <hashTree>
          <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="HTTP Request" enabled="true">
            <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
              <collectionProp name="Arguments.arguments"/>
            </elementProp>
            <stringProp name="HTTPSampler.domain"></stringProp>
            <stringProp name="HTTPSampler.port"></stringProp>
            <stringProp name="HTTPSampler.protocol"></stringProp>
            <stringProp name="HTTPSampler.contentEncoding"></stringProp>
            <stringProp name="HTTPSampler.path">www.google.com</stringProp>
            <stringProp name="HTTPSampler.method">GET</stringProp>
            <boolProp name="HTTPSampler.follow_redirects">false</boolProp>
            <boolProp name="HTTPSampler.auto_redirects">true</boolProp>
            <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
            <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
            <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
            <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
            <stringProp name="HTTPSampler.mimetype"></stringProp>
            <stringProp name="HTTPSampler.monitor">false</stringProp>
            <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
          </HTTPSampler>
          <hashTree/>
        </hashTree>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

Severity: normal
OS: Windows Vista

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Thanks for the report.

As far as I can tell, I have fixed it in the following change:

URL: http://svn.apache.org/viewvc?rev=772819&view=rev
Log:
#2233 - Using the same module name in command line mode causes NPE

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
URL: http://svn.apache.org/r1511216
Log:
Add test for #2233 to guard against regression

Added:
jmeter/trunk/bin/testfiles/Bug47165.csv (with props)
jmeter/trunk/bin/testfiles/Bug47165.jmx (with props)
jmeter/trunk/bin/testfiles/Bug47165.xml (with props)
Modified:
jmeter/trunk/build.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant