Bug 65257

Summary: JMESPathExtractor writes error logs entries if JMESPath filter returns empty result
Product: JMeter Reporter: Dietmar Berchtold <dietmar.berchtold>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal Keywords: FixedInTrunk
Priority: P2    
Version: 5.4.1   
Target Milestone: JMETER_5.5   
Hardware: PC   
OS: All   
Attachments: JMX to reproduce error
Screenshot showing error log entry

Description Dietmar Berchtold 2021-04-22 08:55:19 UTC
Created attachment 37819 [details]
JMX to reproduce error

Steps to reproduce:
 - Run attached jmx file
 - check logs
 -> such log entries are written:
ERROR o.a.j.e.j.j.JMESPathExtractor: Error processing JSON content in JSON JMESPath Extractor, message: Index 0 out of bounds for length 0

Expected: no log entry is written as with the "JSON Extractor"
Comment 1 Dietmar Berchtold 2021-04-22 08:56:29 UTC
Created attachment 37820 [details]
Screenshot showing error log entry
Comment 2 Felix Schumacher 2021-04-24 11:01:09 UTC
Thanks for the report. This should be fixed in trunk. Can you test the next nightly or trunk build?

commit 0dce105f13c7d95ef84225984c5c2c1a967243a8
AuthorDate: Sat Apr 24 11:31:25 2021 +0200

    JMESPathExtractor writes error log entries if JMESPath filter returns empty result
    
    Bugzilla Id: 65257
---
 .../org/apache/jmeter/extractor/json/jmespath/JMESPathExtractor.java    | 2 +-
 xdocs/changes.xml                                                       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

commit 4206445d058b1e1cbae8e71f07c5f6d1e2e91935
AuthorDate: Sat Apr 24 12:24:43 2021 +0200

    JMESPathExtractor writes error log entries if JMESPath filter returns empty result
    
    Second try to fix the bug.
    
    Bugzilla Id: 65257
---
 .../org/apache/jmeter/extractor/json/jmespath/JMESPathExtractor.java  | 4 +++-
 .../apache/jmeter/extractor/json/jmespath/TestJMESPathExtractor.java  | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

commit 5921a91d95957f328a46f01adc780a507860f05a
AuthorDate: Sat Apr 24 12:42:43 2021 +0200

    JMESPathExtractor writes error log entries if JMESPath filter returns empty result
    
    Third try to fix the bug and make the linter happy.
    
    Bugzilla Id: 65257
---
 .../org/apache/jmeter/extractor/json/jmespath/JMESPathExtractor.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 3 Dietmar Berchtold 2021-04-27 08:57:52 UTC
Thanks for solving the issue.

I checked using build https://ci-builds.apache.org/job/JMeter/job/JMeter-trunk/254/ and can confirm issue is solved.