title: Error invoking bsh method:....Error in method invocation: Method createCa( int ) not found in class'cacreator.CaCreator'
body: <p>I am pretty new to Jmeter tool and I am trying to use my own java class to call a function in BeanShell Pre-Processor.
  I have written a Java programme and packaged it into a .jar file and copied it into the /lib/ext folder where the Jmeter is installed.
  Here is my java class snippet:</p>
  
  <pre><code>package cacreator;
  import java.util.Scanner;
  
  public class CaCreator {
  
  static  String Name = "\"Name\" : 11";
  static  String AppName = "\"ApplicationGroup\" : \"qa\"";
  static  String caValues = ""; // = "[{";
  
  public static String createCa(int count)
  {
  
      for (int vCount = 1; vCount &lt;= count; vCount++) {
          caValues = caValues.concat( "\n" + "{ \n" + Name + ", \n\"Value\" : \"" + vCount+300 + "\",\n" + AppName + "\n}");
          if(vCount != count)
          {
              caValues = caValues.concat(",");
             // caValues = caValues.concat("\"Name\" : \"Test");
          }
      }
      return caValues;
  }
  </code></pre>
  
  <p>and the code for BeanShell Pre-Processor:</p>
  
  <pre><code>import cacreator.CaCreator;
  CaCreator obj1 = new CaCreator();
  int firstParam = Integer.parseInt(bsh.args[0]);
  String outPut = obj1.createCa(firstParam);
  vars.put("ca", outPut);
  </code></pre>
  
  <p>i am getting the following errors:</p>
  
  <pre><code>ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval   Sourced file: inline evaluation of: ``import cacreator.CaCreator; CaCreator obj1 = new CaCreator(); int firstParam = I . . . '' : Typed variable declaration : Error in method invocation: Method createCa( int ) not found in class'cacreator.CaCreator'
  WARN  - jmeter.modifiers.BeanShellPreProcessor: Problem in BeanShell script org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval    Sourced file: inline evaluation of: ``import cacreator.CaCreator; CaCreator obj1 = new CaCreator(); int firstParam = I . . . '' : Typed variable declaration : Error in method invocation: Method createCa( int ) not found in class'cacreator.CaCreator' 
  </code></pre>
  
  <p>Thanks in advance!</p>