Search code examples
nullpointerexceptionjmeter

"java.lang.NullPointerException" error in JMeter Non-Gui mode


When I try to execute JMeter (Version 5.1.1 & 5.2.1) recorded script in Non-Gui mode using distributed testing, It is displaying below shown "java.lang.NullPointerException" error while generating HTML report. Also JTL report is creating an empty notepad file without any data.

.

Note:- This error occurrs only when I place CSV Data Set Config - Config Element in the test plan. When I remove/disable it, HTML and JTL reports get generated without any error. Also I can't skip this CSV Data Set Config plugin on test execution.

.

Please let me know, If there is any other solution to overcome this issue.

Thanks in advance.

enter image description here


Solution

  • You're highlightling not the cause but rather a consequence, you should be rather paying attention to the Summariser output which states summary = 0

    enter image description here

    which basically means that no Samplers were executed so your test script execution on slaves failed somewhere somehow. First of all I would recommend checking jmeter.log on the master and jmeter-server.log files on the remote machines, most probably you will be able to figure out the root cause from there.

    Quick checklist:

    1. Make sure to use the same Java version on the master and the slaves
    2. Make sure to use the same JMeter version (better the latest one) on the master and the slaves
    3. If your test relies on JMeter Plugins - you need to install all the plugins used in the test onto all the slaves
    4. If you define some properties in user.properties file you need to do the same on all the remote machines (or alternatively pass them via -G command-line argument)
    5. If you're using external 3rd-party files (CSV files, files to be uploaded, etc.) - you will need to manually copy them to the slave machines
    6. Double check Remote hosts and RMI configuration to ensure that the slaves can communicate with the master in order to send Sample Results back to it. Also make sure that the relevant ports are open in Windows Firewall

    More information: How to Perform Distributed Testing in JMeter