Jmeter NullPointerException when running the GUI

笑着哭i 提交于 2021-02-05 09:26:06

问题


I have installed Jmeter using

brew install Jmeter

when I run

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

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 version:

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?


回答1:


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.

According to the 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article:

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

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

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



来源:https://stackoverflow.com/questions/59164207/jmeter-nullpointerexception-when-running-the-gui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!