title: Call a java method with JMeter
body: <p>My problem is about JMeter and the BeanShell PostProcessor.</p>
  
  <p>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. </p>
  
  <p>When I call <code>java -jar C:\Program Files\apache-jmeter-2.9\lib\ext\myJar.jar</code> everything works fine.</p>
  
  <p>Now I want to call the method in my jar inside JMeter. Inside my Beanshell processor I put this code : </p>
  
  <pre><code>import bsh.LoadProperties;
  import bsh.SSOTokenHelper;
  
  LoadProperties loadProperties = new LoadProperties();
  loadProperties.init();
  
  result = SSOTokenHelper.getSecurityToken();
  </code></pre>
  
  <p>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 : </p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>Thanks for your help.</p>