Blazemeter / CitrixPlugin

A repository for the Citrix Plugin for JMeter
Apache License 2.0
11 stars 2 forks source link

NullPointerException in Citrix Application Launcher (release 0.7.7 only) #70

Open mhlfst opened 9 months ago

mhlfst commented 9 months ago

Hi,

after recording the start of my application with the Blazemeter Citrix Recording template, I can replay from JMeter GUI without any issues. But as soon as I run the jmx via jmeter-n.cmd, I get the following error:

2023-09-19 08:50:56,053 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'Citrix Application Launcher'. java.lang.NullPointerException: null at com.blazemeter.jmeter.citrix.sampler.CitrixBaseSampler.initClient(CitrixBaseSampler.java:117) ~[citrix-jmeter-0.7.7.jar:?] at com.blazemeter.jmeter.citrix.sampler.StartApplicationSampler.initClient(StartApplicationSampler.java:49) ~[citrix-jmeter-0.7.7.jar:?] at com.blazemeter.jmeter.citrix.sampler.CitrixBaseSampler.createClient(CitrixBaseSampler.java:127) ~[citrix-jmeter-0.7.7.jar:?] at com.blazemeter.jmeter.citrix.sampler.CitrixBaseSampler.sample(CitrixBaseSampler.java:272) ~[citrix-jmeter-0.7.7.jar:?] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) [ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) [ApacheJMeter_core.jar:5.6.2] at java.lang.Thread.run(Unknown Source) [?:?]

In the jtl file, the last entry is "Request ICA File" (responseCode: 200, success: true). The ica file was downloaded and can be run manually.

When I remove jmeter\lib\ext\citrix-jmeter-0.7.7.jar and put in citrix-jmeter-0.7.6.jar, running the test via jmeter-n.cmd works just fine.

mhlfst commented 7 months ago

Hello,

I think I found the reason for this error. In CitrixBaseSampler.java, the method initClient has been changed.

In release 0.7.6 the method was empty. In release 0.7.7 the method contains GuiPackage.getInstance().getTreeModel().getRoot() (line 117).

The NullPointerException occurs because GuiPackage.getInstance() is null when the test is run in non-GUI mode.

Please fix this in the next version. Thank you!