JMeter:尝试保存测试计划时为什么会出错

时间:2019-07-24 19:35:42

标签: java jmeter jmeter-5.0

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

我安装了apache-jmeter-5.1.1和java 1.8.0_221(8),并且正在通过getting started guide来在GUI中构建Web测试计划。但是,当我单击“保存”以保存测试计划时,会收到上述错误。

调试器中的完整输出:

2019-07-24 15:30:13,306 ERROR o.a.j.JMeter: Uncaught exception: 
java.lang.NoClassDefFoundError: Could not initialize class org.apache.jmeter.gui.util.FileDialoger
    at org.apache.jmeter.gui.action.Save.computeFileName(Save.java:203) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.gui.action.Save.doAction(Save.java:165) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:88) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:70) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at java.awt.event.InvocationEvent.dispatch(Unknown Source) ~[?:1.8.0_221]
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:1.8.0_221]
    at java.awt.EventQueue.access$500(Unknown Source) ~[?:1.8.0_221]
    at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_221]
    at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_221]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_221]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_221]
    at java.awt.EventQueue.dispatchEvent(Unknown Source) ~[?:1.8.0_221]
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_221]
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_221]
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_221]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_221]
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_221]
    at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_221]

任何想法如何解决?

2 个答案:

答案 0 :(得分:0)

尝试以下操作:

  1. 打开JMeter->选项->外观->选择任何其他主题 除了德古拉。
  2. 重新启动JMeter创建测试计划并尝试 保存。
  3. 保存应该可以。

答案 1 :(得分:0)

如果您在选择“打开项目”或“保存项目”选项后看到以下错误,则为

java.lang.ExceptionInInitializerError: null
at org.apache.jmeter.gui.action.Load.doActionAfterCheck(Load.java:76) ~[ApacheJMeter_core.jar:5.1 r1853635]
at org.apache.jmeter.gui.action.AbstractActionWithNoRunningTest.doAction(AbstractActionWithNoRunningTest.java:45) ~[ApacheJMeter_core.jar:5.1 r1853635]
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:88) ~[ApacheJMeter_core.jar:5.1 r1853635]
at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:70) ~[ApacheJMeter_core.jar:5.1 r1853635]

在Windows 10上使用jmeter 5.0或更高版本的解决方案:

  1. JMeter->选项->外观->选择Darcula以外的其他主题。
  2. 重新启动JMeter
  3. 打开/保存选项应该起作用

可能是最适合您的。