tuanhiep / mqttjmeter

This is the plugin for Jmeter to Test MQTT protocol
Apache License 2.0
86 stars 56 forks source link

Class not found exception after changing message.properites in jmeter #21

Open rahulbhanushali opened 8 years ago

rahulbhanushali commented 8 years ago

I am facing problems installing mqtt-jmeter plugin. I have changed the contents of the message.properties file inside the resources folder of ApacheJMeter_core.jar file with the one inside mqtt-jmeter repo (as mentioned in the README file). However, when I execute JMeter after making this change I get the following error:

java.lang.ClassNotFoundException: org.apache.jmeter.JMeter at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.apache.jmeter.NewDriver.main(NewDriver.java:255)

If I undo the changes in message.properties and run again, JMeter runs without any errors.

Please help in setting up the plugin.

vishwashet76 commented 5 years ago

While creating jar after updating the message.properties, there is a path mismatch. Just check the folder structure of the new jar and old jar.

Steps to update the ApacheJMeter_core.jar :

  1. Copy the "messages.properties" file from the github project - https://github.com/tuanhiep/mqtt-jmeter : /org/apache/jmeter/resources/ folder
  2. Extract the ApacheJMeter_core.jar present in the repository lib/ext of Jmeter.
  3. Replace the existing messages.properties file present in extracted ApacheJMeter_core.jar of Jmeter(lib/ext) : /org/apache/jmeter/resources/messages.properties with the "messages.properties" file from the github project - https://github.com/tuanhiep/mqtt-jmeter : /org/apache/jmeter/resources/ folder
  4. Create ApacheJMeter_core.jar again from the extracted jar file. Command to create jar: jar cvf ApacheJMeter_core.jar org
  5. Now replace the jmeter(lib/ext) ApacheJMeter_core.jar with new jar created in step4.