https://bz.apache.org/bugzilla/show_bug.cgi?id=60829

            Bug ID: 60829
           Summary: NPE when addNewThread in Remote Test
           Product: JMeter
           Version: Nightly (Please specify date)
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

I use a groovy script to add Vuser on the fly with the new addNewTread API like
this :

Groovy code : 

if ( ctx.getThreadGroup().getNumThreads() <  vuser ) {
        if ( !isValidating ) {
                // Start new Vuser 
                ctx.getThreadGroup().addNewThread( ramp_time, ctx.getEngine() )
        }
}

On a local test, no problem, it work !
But when I start it in a remote test mode, a NPE occur with this stack trace on
the slave node :


javax.script.ScriptException: java.lang.NullPointerException
        at
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320)
~[groovy-all-2.4.9.jar:2.4.9]
        at
org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:72)
~[groovy-all-2.4.9.jar:2.4.9]
        at javax.script.CompiledScript.eval(CompiledScript.java:92)
~[?:1.8.0_111]
        at
org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:192)
~[ApacheJMeter_core.jar:3.2-SNAPSHOT.20170302]
        at
org.apache.jmeter.protocol.java.sampler.JSR223Sampler.sample(JSR223Sampler.java:69)
[ApacheJMeter_java.jar:3.2-SNAPSHOT.20170302]
        at
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:486)
[ApacheJMeter_core.jar:3.2-SNAPSHOT.20170302]
        at
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425)
[ApacheJMeter_core.jar:3.2-SNAPSHOT.20170302]
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254)
[ApacheJMeter_core.jar:3.2-SNAPSHOT.20170302]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: java.lang.NullPointerException
        at
org.apache.jmeter.threads.ThreadGroup.addNewThread(ThreadGroup.java:373)
~[ApacheJMeter_core.jar:3.2-SNAPSHOT.20170302]
        at org.apache.jmeter.threads.ThreadGroup$addNewThread$0.call(Unknown
Source) ~[?:?]
        at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
~[groovy-all-2.4.9.jar:2.4.9]
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
~[groovy-all-2.4.9.jar:2.4.9]
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
~[groovy-all-2.4.9.jar:2.4.9]
        at Script98.run(Script98.groovy:147) ~[?:?]
        at
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:317)
~[groovy-all-2.4.9.jar:2.4.9]

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to