Bug 51268

Summary: HTTPS request through an invalid proxy causes NullPointerException and does not show in result tree
Product: JMeter - Now in Github Reporter: Willem Hajenius <w.a.hajenius>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major    
Priority: P2    
Version: 2.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Test script (.jmx) and log files

Description Willem Hajenius 2011-05-26 09:10:11 UTC
Created attachment 27070 [details]
Test script (.jmx) and log files

When performing a HTTPS request through a non-existing proxy server (i.e. there is a value specified, but it's not an actual valid proxy server), JMeter internally gives a NullPointerException and *does not show the (failed) sampler result* in the listeners. As a consequence, the user has no idea that anything went seriously wrong, unless the missing result is noticed.

This can easily be reproduced, please see attached files:
"HTTPS_request.jmx" does a simple HTTPS request and displays the result.

(1) Start JMeter with VALID --proxyHost and --proxyPort parameters
(2) Run the test
(3) You get a green result in the table. This corresponds to attached log "jmeter_with_good_proxy.log"

(4) Start JMeter with INVALID --proxyHost and --proxyPort parameters
(5) Run the test
(6) You get NO result in the table. This corresponds to attached log "jmeter_with_bad_proxy.log" 

I'm using version 2.4 r961953. As you can see from the log, for an invalid proxy it gives a NullPointerException that bubbles up.
Comment 1 Sebb 2011-05-26 11:07:13 UTC
This looks to be a bug in Java; it should not generate an NPE.
If there is a problem with the proxy, it should report an IOError, which would be handled as a sampler error.

You appear to be using Java version 1.5.0_12 which is quite old.
Does the problem still occur with the latest Java version?
Comment 2 Sebb 2011-05-26 12:17:37 UTC
Even though the NPE should not happen, it's easy enough to allow for it by catching Exception rather than just the expected failures.

URL: http://svn.apache.org/viewvc?rev=1127881&view=rev
Log:
Bug 51268 - HTTPS request through an invalid proxy causes NullPointerException and does not show in result tree.
Rather than delegating to the JMeter thread handler for "unexpected" failures, ensure all Exceptions generate a sample error.

Modified:
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
   jakarta/jmeter/trunk/xdocs/changes.xml
Comment 3 Sebb 2011-09-17 00:34:33 UTC
Assuming this is now fixed; if not, please reopen with details.
Comment 4 The ASF infrastructure team 2022-09-24 20:37:46 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2494