1
votes

I am trying to run a very simple test in Jenkins using JMeter.

JMeter Version 2.13 & Running Jenkins Locally and JMeter is also stored locally.

Executing in Jenkins using windows batch command.

when running the job in Jenkins i get the following error message in Console Output:

Uncaught Exception java.lang.ExceptionInInitializerError. See log file for details. Uncaught Exception java.lang.NoClassDefFoundError: Could not initialise class org.apache.jmeter.gui.util.MenuFactory. See log file for details.

I went to manage Jenkins and system logs but no information in there.

Any ideas?

1
What's the exact command you are running from windows batch? - gile
C:\Work\PerformanceTesting\JMeter\apache-jmeter-2.13\bin\jmeter.bat -Jjmeter.save.saveservice.output_format=xml -n -t C:\Work\PerformanceTesting\JMeter\JMX files\Test.jmx -l Test.jtl - Rishi
I assume that if you manually run the same jmeter.bat without supplynig the command line arguments, you're able to see the GUI and use it without any issue? - Morfic
Yes manually it works fine. - Rishi
Did you check jmeter.log file? - gile

1 Answers

1
votes

As it is java related exception, please check your jdk settings in jenkins by follwing below steps

  1. Manage Jenkins -> Global Tool Configuration. You can find JDK tab.
  2. Under JDK give the path of jdk folder for Java_Home variable

Please take free style project in jenkins and configure as in below images

In the place of directory under custom work space give the path of bin folder of jmeter

enter image description here

In the place of Test.jmx give your jmx file name

enter image description here

When you build the project you can see the console output as below image

enter image description here