title: : Error invoking bsh method: eval Sourced file: inline evaluation of: ``
body: <p>This is the code I'm trying to execute in <strong>beanshell sampler</strong>:</p>
  
  <pre><code>import java.lang.*;
  import java.util.*;
  
  String name_lead = vars.get("Name_lead");
  
  String[] lead = name_lead.split("\\s+");
  //vars.put("myname",lead[0]);
  //vars.put("myname1",lead[1]);
  //vars.put("myname2",lead[2]);
  for(int i=1; i&lt;=Integer.parseInt(vars.get("title_pass_matchNr")); i++)
  {
      String title = vars.get("title_pass_"+i);
      String fname = vars.get("firstname_"+i);
      String lname = vars.get("lastname_"+i);
      String[] fn = fname.split("");
  //vars.put("title",title);
  //vars.put("fname",fn[1]);
  //vars.put("lname",lname);
  
      if(lead[i-1].equals(title) &amp;&amp; lead[i].equals(fn[1]) &amp;&amp; lead[i+1].equals(lname))
      {
          vars.put("namep",lead[i]);
      }
  }
  </code></pre>
  
  <p>But I'm getting the following error:</p>
  
  <blockquote>
    <p><strong>Response message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval  Sourced file: inline evaluation of: ``import java.lang.<em>; import java.util.</em>; String name_lead=vars.get("Name_lead");  . . . ''</strong></p>
  </blockquote>
  
  <p>I'm not able to understand it. Can sombody help me? How do I fix this?</p>
  
  <p><code>name_lead</code> has something like Mr P singh ..and taking using regex extractor</p>