gpt4 book ai didi

java - 运行 GUI 时出现 Jmeter NullPointerException

转载 作者:行者123 更新时间:2023-12-02 09:13:52 29 4
gpt4 key购买 nike

我已经使用安装了 Jmeter

brew install Jmeter

当我运行时

jmeter

从命令行我收到此错误:

mac@macbook ~ $ jmeter
================================================================================
Don't use GUI mode for load testing !, only for Test creation and Test
debugging. For load testing, use CLI Mode (was NON GUI):
jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder] & increase Java Heap to meet your test requirements: Modify current
env variable HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m" in the
jmeter batch file Check :
https://jmeter.apache.org/usermanual/best-practices.html
================================================================================
An error occurred: null

我检查了 jmeter.log 文件,这就是我得到的:


2019-12-03 09:48:06,190 ERROR o.a.j.JMeter: An error occurred:
java.lang.NullPointerException: null at
java.awt.Window.init(Window.java:497) ~[?:1.8.0_231] at
java.awt.Window.<init>(Window.java:537) ~[?:1.8.0_231] at
java.awt.Frame.<init>(Frame.java:420) ~[?:1.8.0_231] at
java.awt.Frame.<init>(Frame.java:385) ~[?:1.8.0_231] at
javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1763)
~[?:1.8.0_231] at
javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1838)
~[?:1.8.0_231] at javax.swing.JWindow.<init>(JWindow.java:187)
~[?:1.8.0_231] at javax.swing.JWindow.<init>(JWindow.java:139)
~[?:1.8.0_231] at
org.apache.jmeter.SplashScreen.<init>(SplashScreen.java:45)
~[ApacheJMeter_core.jar:5.2.1] at
org.apache.jmeter.JMeter.startGui(JMeter.java:376)
~[ApacheJMeter_core.jar:5.2.1] at
org.apache.jmeter.JMeter.start(JMeter.java:545)
[ApacheJMeter_core.jar:5.2.1] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[?:1.8.0_231] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:1.8.0_231] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:1.8.0_231] at java.lang.reflect.Method.invoke(Method.java:498)
~[?:1.8.0_231] at
org.apache.jmeter.NewDriver.main(NewDriver.java:253)
[ApacheJMeter.jar:5.2.1]

Java版本:

java version "1.8.0_231" Java(TM) SE Runtime Environment (build
1.8.0_231-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

有人能解决这个问题吗?

最佳答案

您使用的情况是DisplayLink吗? ?如果是这样,您很可能正在遭受 Java Apps crash on launch if connected to external DisplayLink device 的困扰问题。

根据9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure文章:

Use Up-to-Date Software

Your test might fail if your software is out of date. Make sure you’re using the most recent versions of the following:

Java - use the latest 64-bit version of Java SE JDK or Server JRE where possible

因此,如果您必须留在 Java 8 - 请考虑升级到 Java SE Development Kit 8u231 (或任何最新的稳定补丁级别),否则获取最新版本 Java Runtime Environment or SDK

如果您无法修改 Java 版本 - 请考虑删除此 DisplayLink 设备。

关于java - 运行 GUI 时出现 Jmeter NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59164207/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com