1

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?

timbre timbre
  • 12,648
  • 10
  • 46
  • 77
Rishi
  • 115
  • 2
  • 14
  • What's the exact command you are running from windows batch? – gile Mar 31 '17 at 10:34
  • 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 Mar 31 '17 at 10:35
  • 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 Mar 31 '17 at 11:04
  • Yes manually it works fine. – Rishi Mar 31 '17 at 13:28
  • Did you check jmeter.log file? – gile Mar 31 '17 at 15:20
  • Always use the latest version of JMeter and its plugins and Jenkins plugin. The error might be due to jar conflicts also. – NaveenKumar Namachivayam Mar 31 '17 at 16:05
  • Possible duplicate of [java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.gui.util.MenuFactory](http://stackoverflow.com/questions/41196866/java-lang-noclassdeffounderror-could-not-initialize-class-org-apache-jmeter-gui) – timbre timbre Mar 31 '17 at 16:30

1 Answers1

1

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

Karthikeya
  • 324
  • 3
  • 10