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

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 

 

Environment

All supported DevTest releases.

Cause

Invalid JSON Path Filter configuration caused the issue.

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 refer to section "JSON Path Filter" in DevTest documentation for the version being run.