2
votes

My problem is about JMeter and the BeanShell PostProcessor.

I have developped a Java project with Eclipse and exported that project in a jar. I have put this jar in /lib/ext folder of JMeter.

When I call java -jar C:\Program Files\apache-jmeter-2.9\lib\ext\myJar.jar everything works fine.

Now I want to call the method in my jar inside JMeter. Inside my Beanshell processor I put this code :

import bsh.LoadProperties;
import bsh.SSOTokenHelper;

LoadProperties loadProperties = new LoadProperties();
loadProperties.init();

result = SSOTokenHelper.getSecurityToken();

For information, it's the exact code that I have in my main class. But in the log file of Jmeter I have this message :

jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``import bsh.LoadProperties; import bsh.SSOTokenHelper; LoadProperties loadProper . . . '' : Method Invocation SSOTokenHelper.getSecurityToken

I don't understand why it's working when I call my jar directly and why it's not working when i do the exact same thing by JMeter.

Thanks for your help.

1

1 Answers

1
votes

bsh.SSOTokenHelper isn't a real BeanShell class, according to the javadocs at http://www.beanshell.org/javadoc/index.html. You probably need to correct the import, or if you've made up the SSOTokenHelper class, put it in a different package to avoid confusion and make sure its class is available to JMeter.