-1

I have a Java project that I need to run as a load test in JMeter. Found some examples that indicated you could make a jar file and put it in the Jmeter lib/ext folder and run it. Works for the simple example program I wrote.

Tried to scale up, made a jar of my larger project, placed it in the lib/ext folder, did the following in Beanshell sampler following the example program.

import package.JHelper;
JHelper x = new JHelper();
x.test();

I have also tried to import the class using the full path of

import cast.sa.vsp.package.JHelper;
import cast.sa.vsp.package.*;

Both return me the following response code

Response message: org.apache.jorphan.util.JMeterException: Error invoking  bsh method: eval Sourced file: inline evaluation of: ``import cast.sa.vsp.package.JHelper; JHelper x = new JHelper();  . . . '' : Typed variable declaration : Class: JHelper not found in namespace

The only answer I have seen is that it would work if I moved it from /lib/ext to /lib. I have done this as well, with Jmeter being unable to run until I remove the jar from that directory.

Does anyone have any advice on how to get this working?

ncable
  • 1
  • 2
  • Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on Stack Overflow. For more details see http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts – Bacteria Jun 02 '15 at 19:15

1 Answers1

1
  1. Your jars should go to /lib folder (instead of /lib/ext)
  2. JMeter restart is absolutely required to pick the jars up
  3. It is not very recommended to use Beanshell for creating actual load, consider switching to JSR223 Sampler using "groovy" as a language instead.

For details on JSR223 Sampler performance, instructions on how to install groovy scripting engine and performance benchmarks see Beanshell vs JSR223 vs Java JMeter Scripting: The Performance-Off You've Been Waiting For! article.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Why does placing the jar in the /lib directory keep jmeter from running? – ncable Jun 03 '15 at 14:25
  • What does *jmeter.log* say? It shouldn't unless there is a conflict with your jar contents and libraries JMeter relies on – Dmitri T Jun 03 '15 at 15:17