Virtual service throws "Unexpected exception thrown during evaluation of 'JSON Path Filter': null" error

book

Article ID: 225522

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

When requests are sent against a Virtual Service, seen the below errors

============================================================================
| Exception: 
============================================================================
| Step:        Virtual HTTPS Listener 4553
----------------------------------------------------------------------------
| Message:     Unexpected exception thrown during evaluation of 'JSON Path Filter': null
----------------------------------------------------------------------------
| Trapped Exception: null
| Trapped Message:   java.lang.NullPointerException
----------------------------------------------------------------------------
STACK TRACE
java.lang.NullPointerException
 at com.ca.lisa.apptest.json.FilterJSONGet.subPostFilter(FilterJSONGet.java:136)
 at com.itko.lisa.test.FilterBaseImpl.subFilter(FilterBaseImpl.java:148)
 at com.itko.lisa.test.FilterBaseImpl.postFilter(FilterBaseImpl.java:126)
 at com.itko.lisa.test.TestNode.doFilters(TestNode.java:1573)
 at com.itko.lisa.test.TestNode.doPostFilters(TestNode.java:1522)
 at com.itko.lisa.test.TestNode.executeNode(TestNode.java:1009)
 at com.itko.lisa.test.TestCase.execute(TestCase.java:1297)
 at com.itko.lisa.test.TestCase.execute(TestCase.java:1198)
 at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1183)
 at com.itko.lisa.test.TestCase.executeTest(TestCase.java:1124)
 at com.itko.lisa.coordinator.Instance.run(Instance.java:208)
============================================================================


 at com.ca.lisa.apptest.json.FilterJSONGet.subPostFilter(FilterJSONGet.java:190)
 at com.itko.lisa.test.FilterBaseImpl.subFilter(FilterBaseImpl.java:148)
 at com.itko.lisa.test.FilterBaseImpl.postFilter(FilterBaseImpl.java:126)
 at com.itko.lisa.test.TestNode.doFilters(TestNode.java:1573)
 at com.itko.lisa.test.TestNode.doPostFilters(TestNode.java:1522)
 at com.itko.lisa.test.TestNode.executeNode(TestNode.java:1009)
 at com.itko.lisa.test.TestCase.execute(TestCase.java:1297)
 at com.itko.lisa.test.TestCase.execute(TestCase.java:1198)
 at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1183)
 at com.itko.lisa.test.TestCase.executeTest(TestCase.java:1124)
 at com.itko.lisa.coordinator.Instance.run(Instance.java:208)
2021-10-05 03:00:38,811Z (23:00) [VS_TEST_Dev01  ERROR com.itko.lisa.test.TestCase    - Caught a throwable; raising EVENT_TESTRUNERROR 

 

Cause

Invalid JSON Path Filter configuration caused the issue.

Environment

Release : 10.6

Component : Service Virtualization

Resolution

JSON Path Filter is using the lisa.vse.request property to filter the json value and it is not evaluating properly because the property will have the complete request with POST call and arguments, which makes it invalid JSON.

Recommended to use the property lisa.vse.http.current.transaction.body or the TestStepName.rsp instead of lisa.vse.request in JSON Path Filter -->Filter In field and using the correct syntax for the JSON Path should resolve the issue. For more information on JSON Path Filter, look at the documentation at https://techdocs.broadcom.com/us/en/ca-enterprise-software/devops/devtest-solutions/10-6/reference/filter-descriptions/json-filters/json-path-filter.html