运行 GUI 时出现 Jmeter NullPointerException [英] Jmeter NullPointerException when running the GUI

查看:30
本文介绍了运行 GUI 时出现 Jmeter NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用

brew 安装 Jmeter

brew install Jmeter

当我跑步时

jmeter

从命令行我得到这个错误:

from command line i get this error:

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 文件,这是我得到的:

I checked the jmeter.log file and this is what I get:


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)

有人能解决这个问题吗?

anyone was able to fix this?

推荐答案

请问您使用的是DisplayLink?如果是这样,您很可能正在遭受 Java 应用程序在启动时崩溃(如果连接到外部 DisplayLink 设备 问题.

Can it be the case you're using DisplayLink? If so, most probably you're suffering from Java Apps crash on launch if connected to external DisplayLink device issue.

根据针对 JMeter 负载测试内存不足"失败的 9 种简单解决方案文章:

使用最新软件

如果您的软件已过期,您的测试可能会失败.确保您使用的是以下内容的最新版本:

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

Java - 尽可能使用最新的 64 位版本的 Java SE JDK 或 Server JRE

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

因此,如果您必须继续使用 Java 8 - 考虑升级到 Java SE Development Kit 8u231(或任何最新的稳定补丁级别),否则获取最新版本的 Java 运行时环境或 SDK

So if you have to stay at Java 8 - consider upgrading to Java SE Development Kit 8u231 (or whatever is the latest stable patch level), otherwise obtain the latest version of Java Runtime Environment or SDK

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

If you cannot amend Java version - consider removing this DisplayLink device.

这篇关于运行 GUI 时出现 Jmeter NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆