Bug 65257 - JMESPathExtractor writes error logs entries if JMESPath filter returns empty result
Summary: JMESPathExtractor writes error logs entries if JMESPath filter returns empty ...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.4.1
Hardware: PC All
: P2 normal (vote)
Target Milestone: JMETER_5.5
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2021-04-22 08:55 UTC by Dietmar Berchtold
Modified: 2021-04-27 08:57 UTC (History)
0 users



Attachments
JMX to reproduce error (4.68 KB, application/xml)
2021-04-22 08:55 UTC, Dietmar Berchtold
Details
Screenshot showing error log entry (175.48 KB, image/png)
2021-04-22 08:56 UTC, Dietmar Berchtold
Details

Note You need to log in before you can comment on or make changes to this bug.
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.