Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-476

EvaluateJsonPath fails with NullPointerException on null values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.1.0, 0.0.2
    • 0.1.0
    • Extensions
    • None

    Description

      The EvaluateJsonPath processor fails with a NullPointerException when the input JSON has a null value in the contents of a field it is evaluating.

      Caused by: java.lang.NullPointerException
      	at org.apache.nifi.processors.standard.AbstractJsonPathProcessor.getResultRepresentation(AbstractJsonPathProcessor.java:84)
      	at org.apache.nifi.processors.standard.EvaluateJsonPath.onTrigger(EvaluateJsonPath.java:268)
      	at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
      

      null is a valid value in the JSON spec

      The current spec of EvaluateJsonPath from NIFI-360 indicated that any missing fields should be given an empty string attribute value in the output flow file sent to "match".

      null values should either follow this same pattern, or perhaps allow for null values in the output FlowFile attributes to properly indicate the difference between null and an empty String. Either way, EvaluateJsonPath should handle null input values instead of throwing exceptions.

      Attachments

        Issue Links

          Activity

            People

              aldrin Aldrin Piri
              brianghig Brian Ghigiarelli
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: