Bug 55694 - Assertions and Extractors : Avoid NullPointerException when scope is variable and variable is missing
Assertions and Extractors : Avoid NullPointerException when scope is variable...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.9
All All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
: 55773 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-10-23 12:27 UTC by Dmitry
Modified: 2013-11-15 20:54 UTC (History)
2 users (show)



Attachments
test plan for example (4.67 KB, text/plain)
2013-10-23 12:27 UTC, Dmitry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry 2013-10-23 12:27:01 UTC
Created attachment 30957 [details]
test plan for example

2013/10/23 15:25:13 ERROR - jmeter.threads.JMeterThread: Error while processing sampler 'Debug Sampler' : java.lang.NullPointerException
	at org.apache.oro.text.regex.PatternMatcherInput.<init>(Unknown Source)
	at org.apache.jmeter.extractor.RegexExtractor.matchStrings(RegexExtractor.java:210)
	at org.apache.jmeter.extractor.RegexExtractor.processMatches(RegexExtractor.java:191)
	at org.apache.jmeter.extractor.RegexExtractor.process(RegexExtractor.java:114)
	at org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.java:742)
	at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:452)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
	at java.lang.Thread.run(Unknown Source)

I have this error when try to run attached test plan
Comment 1 Sebb 2013-10-23 16:56:32 UTC
The problem is in the Regex Extractor, which is not allowing for a missing variable.

However, the test plan is wrong; the field should contain the NAME of the variable, i.e. "string" (without quotes).
Comment 2 Philippe Mouawad 2013-10-23 19:18:22 UTC
Closing as it's not a bug.
Comment 3 Dmitry 2013-10-23 19:23:51 UTC
(In reply to Philippe Mouawad from comment #2)
> Closing as it's not a bug.

This Null Pointer looks like not handle situation correctly, so from my point of view this is bug
Comment 4 Philippe Mouawad 2013-10-23 19:48:57 UTC
New behaviour warn about missing variable and Default Value is used


Date: Wed Oct 23 19:37:55 2013
New Revision: 1535130

URL: http://svn.apache.org/r1535130
Log:
Bug 55694 - java.lang.NullPointerException if Apply to is set to a missing JMeter variable
Bugzilla Id: 55694

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
    jmeter/trunk/xdocs/changes.xml
Comment 5 Philippe Mouawad 2013-11-15 20:50:55 UTC
*** Bug 55773 has been marked as a duplicate of this bug. ***
Comment 6 Philippe Mouawad 2013-11-15 20:54:02 UTC
Date: Fri Nov 15 20:52:46 2013
New Revision: 1542394

URL: http://svn.apache.org/r1542394
Log:
Bug 55694 - Assertions and Extractors : Avoid NullPointerException when scope is variable and variable is missing
Bugzilla Id: 55694

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/ResponseAssertion.java
    jmeter/trunk/src/components/org/apache/jmeter/assertions/XPathAssertion.java
    jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java
    jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
    jmeter/trunk/src/components/org/apache/jmeter/extractor/XPathExtractor.java
    jmeter/trunk/xdocs/changes.xml