java.lang.NoClassDefFoundError:无法初始化类org.apache.jmeter.gui.util.MenuFactory

时间:2016-12-17 08:45:20

标签: java apache testing jmeter

当我打开apache-jmeter-3.1并右键单击测试计划按钮时,结果是没有响应并在jmeter.log中抛出错误列表,如下所示

2016/12/17 16:24:30 ERROR - jmeter.JMeter: Uncaught exception:  java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.gui.util.MenuFactory
at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:93)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:156)
at org.apache.jmeter.gui.tree.JMeterTreeListener.displayPopUp(JMeterTreeListener.java:248)
at org.apache.jmeter.gui.tree.JMeterTreeListener.mousePressed(JMeterTreeListener.java:193)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

发生了什么,我该如何解决?谢谢 !!!它困扰了我很久......

4 个答案:

答案 0 :(得分:9)

我遇到了类似的问题。 解决方案是改变主题!

尝试以下操作:

  1. 打开 JMeter -> 选项 -> 外观 -> 选择 Darcula 以外的任何其他主题。
  2. 重启 JMeter。

来源:https://www.javaer101.com/en/article/5555703.html

答案 1 :(得分:5)

我面临同样的问题(macOS Big Sur,版本 - 11.2.3 和 Jmeter 版本 5.4.1)。我正在按照这一步“打开 JMeter -> 选项 -> 外观 -> 选择系统”及其作品

enter image description here

答案 2 :(得分:3)

通常情况下,如果不存在Dependent jar,或者如果存在具有不同实现的冲突jar,则会发生这种情况。

查看此帖子 https://newspaint.wordpress.com/2013/08/21/jmeter-could-not-initialize-menufactory-class/

答案 3 :(得分:-1)

我面临同样的问题(即没有一个选项像保存、合并等那样有效)。解决方案是改变主题。

尝试以下操作:

**打开 JMeter -> 选项 -> 外观 -> 选择 Darcula 以外的任何其他主题。

重启 JMeter。**