newspaint

Documenting Problems That Were Difficult To Find The Answer To

Why Won’t My JMeter Java Sampler Class Load?

Infuriating! Having build a Java Sampler for JMeter and having placed it in the lib/ext/ folder I start up JMeter but when I go to add a Java Sampler my custom class isn’t listed as one of those available!

It seems that JMeter is silently failing to load my JAR file.

So what is going on? Clearly we need to make JMeter more verbose. Time to create a properties file. Try this for measure:

log_level.jmeter=DEBUG
log_level.jmeter.junit=DEBUG
log_level.jmeter.control=DEBUG
log_level.jmeter.testbeans=DEBUG
log_level.jmeter.engine=DEBUG
log_level.jmeter.threads=DEBUG
log_level.jmeter.gui=WARN
log_level.jmeter.testelement=DEBUG
log_level.jmeter.util=DEBUG
log_level.jmeter.util.classfinder=DEBUG
log_level.jmeter.test=DEBUG
log_level.jmeter.protocol.http=DEBUG
# For CookieManager, AuthManager etc:
log_level.jmeter.protocol.http.control=DEBUG
log_level.jmeter.protocol.ftp=WARN
log_level.jmeter.protocol.jdbc=DEBUG
log_level.jmeter.protocol.java=WARN
log_level.jmeter.testelements.property=DEBUG
log_level.jorphan=DEBUG

log_file=jmeter-debug.log

Save this as “myprops.txt” (or whatever you like) and then issue the command:

bin/jmeter -p myprops.txt

Now, have a look in the newly created jmeter-debug.log file for the evidence!

2013/02/05 13:53:41 DEBUG - jorphan.reflect.ClassFinder: MyJMeterClass/src/JMeterAction01StartClient : Unsupported major.minor version 51.0

This indicates that the JAR was compiled using the JDK version 7 but I’m trying to run this using the version 6 JRE.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: