JMeter抛出o.a.j.JMeter:未捕获的异常:java.lang.StackOverflowError:空错误

时间:2018-12-07 19:08:27

标签: jmeter

Jmeter引发错误o.j.JMeter:未捕获的异常: java.lang.StackOverflowError:空

使用循环控制器代码$ {__ groovy(vars.get(“ continueLoop”)==“ true”)}的脚本

注意:csv数据文件有2行数据。我仅对1位用户执行测试。

2018-12-07 10:51:20,773错误o.a.j.JMeter:未捕获的异常: java.lang.StackOverflowError:null     在org.apache.jmeter.testelement.AbstractTestElement.getPropertyAsBoolean(AbstractTestElement.java:249)〜[ApacheJMeter_core.jar:5.0 r1840935]     在org.apache.jmeter.protocol.http.control.CookieManager.getClearEachIteration(CookieManager.java:146)〜[ApacheJMeter_http.jar:5.0 r1840935]     在org.apache.jmeter.protocol.http.control.CookieManager.testIterationStart(CookieManager.java:431)〜[ApacheJMeter_http.jar:5.0 r1840935]     在org.apache.jmeter.threads.JMeterThread.notifyTestListeners(JMeterThread.java:971)〜[ApacheJMeter_core.jar:5.0 r1840935]     在org.apache.jmeter.threads.JMeterThread $ IterationListener.iterationStart(JMeterThread.java:1054)〜[ApacheJMeter_core.jar:5.0 r1840935]     在org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:399)〜[ApacheJMeter_core.jar:5.0 r1840935]     在org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:391)〜[ApacheJMeter_core.jar:5.0 r1840935]     在org.apache.jmeter.control.GenericController.next(GenericController.java:160)〜[ApacheJMeter_core.jar:5.0 r1840935]     在org.apache.jmeter.control.LoopController.next(LoopController.java:134)〜[ApacheJMeter_core.jar:5.0 r1840935]     在org.apache.jmeter.control.LoopController.nextIsNull(LoopController.java:166)〜[ApacheJMeter_core.jar:5.0 r1840935]     在org.apache.jmeter.control.GenericController.next(GenericController.java:170)〜[ApacheJMeter_core.jar:5.0 r1840935]

enter image description here

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

您不会显示将continueLoop初始化为true以及将其更改为false的地方。

您应该显示jmeter.log内容(使用pastebin或类似应用程序),因为它肯定包含有助于您的重要信息。

查看有效示例:

    <?xml version="1.0" encoding="UTF-8"?>
    <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.1-SNAPSHOT.20181206">
      <hashTree>
        <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
          <stringProp name="TestPlan.comments"></stringProp>
          <boolProp name="TestPlan.functional_mode">false</boolProp>
          <boolProp name="TestPlan.tearDown_on_shutdown">true</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 name="continueLoop" elementType="Argument">
                <stringProp name="Argument.name">continueLoop</stringProp>
                <stringProp name="Argument.value">true</stringProp>
                <stringProp name="Argument.metadata">=</stringProp>
              </elementProp>
            </collectionProp>
          </elementProp>
          <stringProp name="TestPlan.user_define_classpath"></stringProp>
        </TestPlan>
        <hashTree>
          <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
            <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
            <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>
            <boolProp name="ThreadGroup.scheduler">false</boolProp>
            <stringProp name="ThreadGroup.duration"></stringProp>
            <stringProp name="ThreadGroup.delay"></stringProp>
          </ThreadGroup>
          <hashTree>
            <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="WC" enabled="true">
              <stringProp name="WhileController.condition">${__groovy(vars.get(&quot;continueLoop&quot;) == &quot;true&quot;)}</stringProp>
            </WhileController>
            <hashTree>
              <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="Debug Sampler" enabled="true">
                <boolProp name="displayJMeterProperties">false</boolProp>
                <boolProp name="displayJMeterVariables">true</boolProp>
                <boolProp name="displaySystemProperties">false</boolProp>
              </DebugSampler>
              <hashTree/>
              <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Think Time" enabled="true">
                <intProp name="ActionProcessor.action">1</intProp>
                <intProp name="ActionProcessor.target">0</intProp>
                <stringProp name="ActionProcessor.duration">0</stringProp>
              </TestAction>
              <hashTree>
                <UniformRandomTimer guiclass="UniformRandomTimerGui" testclass="UniformRandomTimer" testname="Pause" enabled="true">
                  <stringProp name="ConstantTimer.delay">100</stringProp>
                  <stringProp name="RandomTimer.range">100</stringProp>
                </UniformRandomTimer>
                <hashTree/>
              </hashTree>
              <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true">
                <stringProp name="IfController.condition">${__jexl3(${__jm__WC__idx} == 10,)}</stringProp>
                <boolProp name="IfController.evaluateAll">false</boolProp>
                <boolProp name="IfController.useExpression">true</boolProp>
              </IfController>
              <hashTree>
                <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Flow Control Action" enabled="true">
                  <intProp name="ActionProcessor.action">1</intProp>
                  <intProp name="ActionProcessor.target">0</intProp>
                  <stringProp name="ActionProcessor.duration">0</stringProp>
                </TestAction>
                <hashTree>
                  <UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="User Parameters" enabled="true">
                    <collectionProp name="UserParameters.names">
                      <stringProp name="-753878037">continueLoop</stringProp>
                    </collectionProp>
                    <collectionProp name="UserParameters.thread_values">
                      <collectionProp name="-544885953">
                        <stringProp name="97196323">false</stringProp>
                      </collectionProp>
                    </collectionProp>
                    <boolProp name="UserParameters.per_iteration">false</boolProp>
                  </UserParameters>
                  <hashTree/>
                </hashTree>
              </hashTree>
            </hashTree>
          </hashTree>
        </hashTree>
      </hashTree>
    </jmeterTestPlan>