Bug 34261

Summary: NPE in HtmlParser when embedded resources are requested and number of threads is big
Product: JMeter - Now in Github Reporter: denka <denka>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal CC: martin, olivere
Priority: P2    
Version: 2.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
URL: n/a

Description denka 2005-04-01 03:17:57 UTC
This NPE causes JMeter to terminate. This does not happen when the number of
theads is low (worked with 200, but failed with 250 for me).

jmeter.threads.JMeterThread: Thread Thread Group 1-510 started 
2005/03/31 16:52:11 INFO  - jmeter.threads.JMeterThread: Thread Thread Group
1-511 started 
2005/03/31 16:52:11 INFO  - jmeter.threads.JMeterThread: Thread Thread Group
1-512 started 
2005/03/31 16:52:11 ERROR - jmeter.threads.JMeterThread: 
java.lang.NullPointerException
	at
org.apache.jmeter.protocol.http.parser.HtmlParserHTMLParser.getEmbeddedResourceURLs(HtmlParserHTMLParser.java:172)
	at
org.apache.jmeter.protocol.http.parser.HTMLParser.getEmbeddedResourceURLs(HTMLParser.java:149)
	at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.downloadPageResources(HTTPSamplerBase.java:640)
	at org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:577)
	at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:590)
	at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:578)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:281)
	at java.lang.Thread.run(Unknown Source)
Comment 1 Sebb 2006-04-29 23:50:43 UTC
The problem does not seem to occur in 2.1.1 - please re-open with details if it
still occurs
Comment 2 Oliver Erlewein 2006-08-09 01:18:27 UTC
Hi all,

This error still happens on Jmeter 2.1.1 (I dod not test this on 2.2).

The error is not consistent. I sometimes happens when you have call to a webpage
(HTTP Sampler) with redirects and resources that have the content length 0. This
also happens only if there are a couple of threads (over 25) running.

Regards Oliver
Comment 3 Robin Houston 2006-11-09 01:15:04 UTC
I'm seeing this problem on JMeter 2.2. In my case, it's happening even when
there are just 10 simultaneous threads, but not when there are 1. Here's the
backtrace:

2006/11/09 04:43:50 ERROR - jmeter.threads.JMeterThread: 
java.lang.NullPointerException
        at
org.apache.jmeter.protocol.http.parser.HtmlParserHTMLParser.getEmbeddedResourceURLs(HtmlParserHTMLParser.java:
163)
        at
org.apache.jmeter.protocol.http.parser.HTMLParser.getEmbeddedResourceURLs(HTMLParser.java:145)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.downloadPageResources(HTTPSamplerBase.java:731)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:961)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:474)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:668)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:657)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:247)
        at java.lang.Thread.run(Thread.java:595)
Comment 4 Sebb 2007-01-21 15:32:04 UTC
I think I've fixed the NPE (SVN 498490).

It will be in the next nightly build dated after this update, see:

http://people.apache.org/builds/jakarta-jmeter/nightly/
Comment 5 Sebb 2007-01-21 15:54:27 UTC
*** Bug 40411 has been marked as a duplicate of this bug. ***
Comment 6 Martin van Dijken 2007-04-12 23:59:29 UTC
Have just verified with the latest nightly build that this problem still occurs.
Can anyone shed some light on how I can work around this bug?
Comment 7 Martin van Dijken 2007-04-13 00:47:16 UTC
Excuse me, this bug IS fixed. I noticed that the stacktrace was not at all
compatible with what I downloaded as nightly source and found that I had
accidentally copied in the jar htmlparserparser.jar from my 2.2 release build. I
can verify now that this bug is actually fixed in the latest nightly build.

Idiotic name btw this jar file, glad it has been removed and put in the main ext.
Comment 8 The ASF infrastructure team 2022-09-24 20:37:34 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1524