When running an AutoSys POJO job configured as a Kafka consumer, the job fails with the following error in the agent logs:
Process Header Key JSONPathExpected to find an object with property ['key'] in path $ but found 'java.lang.String'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.
r24.0 (Agent), r24.1.01 (Scheduler)
The error is caused by the presence of JSONPath parameters in the job definition for Kafka headers that contain simple string values instead of JSON objects. When kafka.HeaderKeyJsonPath or kafka.HeaderValueJsonPath are defined, the JsonSmartJsonProvider attempts to parse the header as a JSON structure. If the header is a standard string, the parsing fails because a string is not a valid JSON object at the root level
To resolve this issue, modify the job definition (JIL) to remove the JSONPath evaluation for headers and use Regex matching instead.
j2ee_parameter lines if they are present and targeting simple string headers:j2ee_parameter: kafka.HeaderKeyJsonPath=...j2ee_parameter: kafka.HeaderValueJsonPath=...j2ee_parameter: kafka.HeaderKeyRegex=[your_regex]j2ee_parameter: kafka.HeaderValueRegex=[your_regex]For more information on configuring POJO job attributes for Kafka, refer to the official documentation: