Use JMeter to Load Test RMI (Remote Method Invocation) Server
By admin on Sep 14, 2007 in Java, Programming, open source
Apache JMeter is a great tool for load testing. However, recently I need to load test a RMI application, and I could not find a JMeter Sampler to test the RMI application.
After some Googling, I gave up and ended up writing my own Sampler using the Java Request Sampler.
Below is the sample screen of the Java Request Sampler that I have written. I can specify the RMI server IP, port, binding name, and also the RMI connection pool size.
You can download the code here.
In order to compile the code, you need the libraries in <JMeter Directory>\lib\ext folder.
After compiling the Java source files, package them into a Jar file, and put it under <JMeter Directory>\lib\ext folder, you can view the new sampler from the Java Request Sampler screen.


tamil vengan | Nov 14, 2007 | Reply
Hi,
Awesome. Great job. Lot of useful tips and tools.
Keep it up.
Thanks,
Tamil
jigar | Jan 25, 2008 | Reply
n order to compile the code, you need the libraries in \lib\ext folder.
( Which library you are taking about)
After compiling the Java source files, package them into a Jar file, and put it under \lib\ext folder, you can view the new sampler from the Java Request Sampler screen.
nbedoui | Jun 24, 2008 | Reply
Bonjour,
Can you explain how exactly? because I can not make it work.
Thanks.
beto | Oct 8, 2008 | Reply
Hi! great sampler, but I can’t make it work, I can compile it and generate the .class files, but jmeter doesn’t seem to ‘read’ the sampler. I’ve tried what you say “After compiling the Java source files, package them into a Jar file, and put it under \lib\ext folder, you can view the new sampler from the Java Request Sampler screen.” and it didn’t worked… I tried changing jmeter’s classpath (on jmeter.properties) and nothing, neither adding the total path to the search paths (also on jmeter.properties), the problem actually isn’t your code, the problem is that jmeter can’t find the classes…. please help!!
jigar: what I did was to add the following jars to java’s classpath
ApacheJMeter_core.jar
ApacheJMeter_java.jar
it does work, in the sense that it compiles, but as I said before, the sampler doesn’t appear on the control panel of the java request sampler, good luck
beto | Oct 9, 2008 | Reply
ok, i’ve managed to made the sampler to show on the menu of possible classes on the java request control panel, I haven’t tried it (and I don’t think I’m gonna do it today), but at least it does appears, this is what I did:
First I ‘unzip’ the ApacheJMeter_java.jar file, this file has the 2 default test classes of Jmeter: SleepTest and JavaTest. This file is located on lib/ext of the jmeter folder
Then, on the org folder (appears when jar is ‘unzipped’), navigate to test folder (org\apache\jmeter\protocol\java\test), and copied the source code of the 4 classes of the RMISampler
Then add the code line package org.apache.jmeter.protocol.java.test; before any import on the 4 .java files
Then compile all of them. I had problems here, the error said something about a wrong class or something like that, so I put the \lib\ext folder (of Jmeter of course) on java’s classpath (this in adition to the other jar’s that I mentioned before), then compile again
Finally, on cmd, while being on the \lib\ext folder of jmeter, I build the jar file again, using both folders, org and META-INF
Done!, if everything went well, the next time you run Jmeter, the RMISampler should appear on the Java request Control Panel
Note: this is probably the worst way of doing it, but at least is a way, if somebody knows another way please post it