Hi all,
I'm going to performance for Chat server using XMPP protocol, so I configure Jmeter as below:
Creating User Define Variable, with 3 variables CHAT_HOST, CHAT_PORT, CHAT_SERVICE , and assign value to them.
Putting 2 Smack 3.2.2 file to /lib folder of Jmeter and creating the Beanshell sampler with the code as below:
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.SASLAuthentication;
import org.jivesoftware.smack.XMPPConnection;
ConnectionConfiguration config = new ConnectionConfiguration();
ConnectionConfiguration.init(vars.get("CHAT_HOST"), vars.get("CHAT_PORT"), vars.get("CHAT_SERVICE"));
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
But, when running the console shows error as below:
WARN - jmeter.protocol.java.sampler.BSFSampler: BSF error org.apache.bsf.BSFException: BeanShell script error: Sourced file: inline evaluation of: ``import org.jivesoftware.smack.ConnectionConfiguration; import org.jivesoftware.s . . . '' : Typed variable declaration : Undefined argument: HOST : at Line: 7 : in file: inline evaluation of: ``import org.jivesoftware.smack.ConnectionConfiguration; import org.jivesoftware.s . . . '' : ( HOST , PORT , SERVICE )
BSF info: script at line: 0 column: columnNo
at bsh.util.BeanShellBSFEngine.eval(BeanShellBSFEngine.java:199)
at org.apache.jmeter.protocol.java.sampler.BSFSampler.sample(BSFSampler.java:104)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
at java.lang.Thread.run(Unknown Source)
Would you like to tell me how to handle this error, and the way to call a class from third party Jar file as I did - is it right or wrong ? If wrong, please instruct me.
Thanks,
ConnectionConfiguration config = new ConnectionConfiguration(vars.get("CHAT_HOST"), Integer.parseInt(vars.get("CHAT_PORT")), vars.get("CHAT_SERVICE"));
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
try {
// do something
} catch (Exception ex) {
log.error("Something went wrong", ex);
throw ex;
}
Each BeanShell test element has its own copy of the interpreter (for each thread). If the test element is repeatedly called, e.g. within a loop, then the interpreter is retained between invocations unless the "Reset bsh.Interpreter before each call" option is selected. For intensive load testing, it is recommended to use a JSR223 scripting language whose ScriptingEngine implements Compilable, see JSR223 section below for more details.
--
You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/tUVhNbl_XK0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.