https://bz.apache.org/bugzilla/show_bug.cgi?id=63065
--- Comment #6 from [email protected] --- Getting below exception java.lang.ClassCastException: Cannot cast java.lang.String to int Point to be noted that the same script is working fine with jmeter 3.0, new java home is updated as required.Do I need to do changes in code,jmeter 5 doesnt have backward compatibilty for the code? Jmeter.log 2019-01-08 11:06:11,137 ERROR o.a.j.u.BeanShellTestElement: BSH threw an exception java.lang.ClassCastException: Cannot cast java.lang.String to int at bsh.Types.castError(Types.java:535) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castError(Types.java:523) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castObject(Types.java:448) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castObject(Types.java:320) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Variable.setValue(Variable.java:103) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Variable.<init>(Variable.java:74) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.NameSpace.createVariable(NameSpace.java:469) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.NameSpace.setTypedVariable(NameSpace.java:860) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:81) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.evalBlock(BSHBlock.java:125) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:75) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:41) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHIfStatement.eval(BSHIfStatement.java:42) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHIfStatement.eval(BSHIfStatement.java:45) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.evalBlock(BSHBlock.java:125) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:75) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:41) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHTryStatement.eval(BSHTryStatement.java:80) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:659) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:750) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:739) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45] at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:166) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:189) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.util.BeanShellTestElement.processFileOrScript(BeanShellTestElement.java:151) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.protocol.java.sampler.BeanShellSampler.sample(BeanShellSampler.java:124) [ApacheJMeter_java.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.0 r1840935] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45] 2019-01-08 11:06:11,151 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``checkDist = vars.get("checkoutDistribution"); int checkDistInt = Integer.parseIn . . . '' : Undefined argument: pdpCase 2019-01-08 11:06:11,152 WARN o.a.j.p.j.s.BeanShellSampler: Exception executing script. org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``checkDist = vars.get("checkoutDistribution"); int checkDistInt = Integer.parseIn . . . '' : Undefined argument: pdpCase 2019-01-08 11:06:11,155 INFO o.a.j.c.LoopController: iterationStart called on PDPLoop with source org.apache.jmeter.control.LoopController@36378dd2 and iteration 2 2019-01-08 11:06:11,155 INFO o.a.j.c.LoopController: iterationStart called on SDP&Scroll loop with source org.apache.jmeter.control.LoopController@36378dd2 and iteration 2 2019-01-08 11:06:11,161 ERROR o.a.j.u.BeanShellTestElement: BSH threw an exception java.lang.ClassCastException: Cannot cast java.lang.String to int at bsh.Types.castError(Types.java:535) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castError(Types.java:523) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castObject(Types.java:448) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castObject(Types.java:320) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Variable.setValue(Variable.java:103) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Variable.<init>(Variable.java:74) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.NameSpace.createVariable(NameSpace.java:469) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.NameSpace.setTypedVariable(NameSpace.java:860) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:81) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.evalBlock(BSHBlock.java:125) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:75) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:41) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHIfStatement.eval(BSHIfStatement.java:42) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.evalBlock(BSHBlock.java:125) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:75) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:41) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHTryStatement.eval(BSHTryStatement.java:80) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:659) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:750) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:739) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45] at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:166) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:189) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.util.BeanShellTestElement.processFileOrScript(BeanShellTestElement.java:151) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.protocol.java.sampler.BeanShellSampler.sample(BeanShellSampler.java:124) [ApacheJMeter_java.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.0 r1840935] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45] 2019-01-08 11:06:11,165 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``checkDist = vars.get("checkoutDistribution"); int checkDistInt = Integer.parseIn . . . '' : Undefined argument: pdpCase 2019-01-08 11:06:11,165 WARN o.a.j.p.j.s.BeanShellSampler: Exception executing script. org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``checkDist = vars.get("checkoutDistribution"); int checkDistInt = Integer.parseIn . . . '' : Undefined argument: pdpCase 2019-01-08 11:06:11,167 INFO o.a.j.c.LoopController: iterationStart called on PDPLoop with source org.apache.jmeter.control.LoopController@36378dd2 and iteration 3 2019-01-08 11:06:11,167 INFO o.a.j.c.LoopController: iterationStart called on SDP&Scroll loop with source org.apache.jmeter.control.LoopController@36378dd2 and iteration 3 2019-01-08 11:06:11,174 ERROR o.a.j.u.BeanShellTestElement: BSH threw an exception java.lang.ClassCastException: Cannot cast java.lang.String to int at bsh.Types.castError(Types.java:535) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castError(Types.java:523) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castObject(Types.java:448) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castObject(Types.java:320) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Variable.setValue(Variable.java:103) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Variable.<init>(Variable.java:74) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.NameSpace.createVariable(NameSpace.java:469) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.NameSpace.setTypedVariable(NameSpace.java:860) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:81) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.evalBlock(BSHBlock.java:125) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:75) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:41) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHIfStatement.eval(BSHIfStatement.java:45) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHIfStatement.eval(BSHIfStatement.java:45) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.evalBlock(BSHBlock.java:125) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:75) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:41) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHTryStatement.eval(BSHTryStatement.java:80) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:659) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:750) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:739) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45] at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:166) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:189) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.util.BeanShellTestElement.processFileOrScript(BeanShellTestElement.java:151) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.protocol.java.sampler.BeanShellSampler.sample(BeanShellSampler.java:124) [ApacheJMeter_java.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.0 r1840935] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45] 2019-01-08 11:06:11,177 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``checkDist = vars.get("checkoutDistribution"); int checkDistInt = Integer.parseIn . . . '' : Undefined argument: pdpCase 2019-01-08 11:06:11,177 WARN o.a.j.p.j.s.BeanShellSampler: Exception executing script. org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``checkDist = vars.get("checkoutDistribution"); int checkDistInt = Integer.parseIn . . . '' : Undefined argument: pdpCase 2019-01-08 11:06:11,179 INFO o.a.j.c.LoopController: iterationStart called on PDPLoop with source org.apache.jmeter.control.LoopController@36378dd2 and iteration 4 2019-01-08 11:06:11,179 INFO o.a.j.c.LoopController: iterationStart called on SDP&Scroll loop with source org.apache.jmeter.control.LoopController@36378dd2 and iteration 4 2019-01-08 11:06:11,184 ERROR o.a.j.u.BeanShellTestElement: BSH threw an exception java.lang.ClassCastException: Cannot cast java.lang.String to int at bsh.Types.castError(Types.java:535) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castError(Types.java:523) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castObject(Types.java:448) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Types.castObject(Types.java:320) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Variable.setValue(Variable.java:103) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Variable.<init>(Variable.java:74) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.NameSpace.createVariable(NameSpace.java:469) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.NameSpace.setTypedVariable(NameSpace.java:860) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:81) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.evalBlock(BSHBlock.java:125) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:75) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:41) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHIfStatement.eval(BSHIfStatement.java:42) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.evalBlock(BSHBlock.java:125) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:75) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHBlock.eval(BSHBlock.java:41) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.BSHTryStatement.eval(BSHTryStatement.java:80) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:659) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:750) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at bsh.Interpreter.eval(Interpreter.java:739) [bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45] at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:166) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:189) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.util.BeanShellTestElement.processFileOrScript(BeanShellTestElement.java:151) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.protocol.java.sampler.BeanShellSampler.sample(BeanShellSampler.java:124) [ApacheJMeter_java.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.0 r1840935] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45] 2019-01-08 11:06:11,188 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``checkDist = vars.get("checkoutDistribution"); int checkDistInt = Integer.parseIn . . . '' : Undefined argument: pdpCase 2019-01-08 11:06:11,188 WARN o.a.j.p.j.s.BeanShellSampler: Exception executing script. org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``checkDist = vars.get("checkoutDistribution"); int checkDistInt = Integer.parseIn . . . '' : Undefined argument: pdpCase 2019-01-08 11:06:11,189 INFO o.a.j.c.LoopController: iterationStart called on PDPLoop with source org.apache.jmeter.control.LoopController@36378dd2 and iteration 5 2019-01-08 11:06:11,189 INFO o.a.j.c.LoopController: iterationStart called on SDP&Scroll loop with source org.apache.jmeter.control.LoopController@36378dd2 and iteration 5 2019-01-08 11:06:11,193 ERROR o.a.j.u.BeanShellTestElement: BSH threw an exception java.lang.ClassCastException: Cannot cast java.lang.String to int -- You are receiving this mail because: You are the assignee for the bug.
