{"record":{"id":"feb5e518c81ac304","repo":"apache/dolphinscheduler","slug":"e-getmessage","errorCode":null,"errorMessage":"${e.getMessage()}","messagePattern":"\\$\\{e\\.getMessage\\(\\)\\}","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-dms/src/main/java/org/apache/dolphinscheduler/plugin/task/dms/DmsTask.java","lineNumber":246,"sourceCode":"        }\n    }\n\n    /**\n     * convert json parameters to dms parameters\n     */\n    public void convertJsonParameters() throws TaskException {\n        // create a new parameter object using the json data if the json data is not empty\n        if (parameters.getIsJsonFormat() && parameters.getJsonData() != null) {\n            String jsonData = ParameterUtils.convertParameterPlaceholders(parameters.getJsonData(),\n                    ParameterUtils.convert(taskExecutionContext.getPrepareParamsMap()));\n\n            boolean isRestartTask = parameters.getIsRestartTask();\n            try {\n                parameters = objectMapper.readValue(jsonData, DmsParameters.class);\n                parameters.setIsRestartTask(isRestartTask);\n            } catch (Exception e) {\n                log.error(\"Failed to convert json data to DmsParameters object.\", e);\n                throw new TaskException(e.getMessage());\n            }\n        }\n    }\n\n    @Override\n    public DmsParameters getParameters() {\n        return parameters;\n    }\n\n    @Override\n    public void cancelApplication() {\n        dmsHook.stopReplicationTask();\n    }\n\n}\n","sourceCodeStart":228,"sourceCodeEnd":262,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-dms/src/main/java/org/apache/dolphinscheduler/plugin/task/dms/DmsTask.java#L228-L262","documentation":"convertJsonParameters re-parses the user's jsonData field into DmsParameters with Jackson when isJsonFormat is true. If the Jackson readValue fails (malformed JSON or schema mismatch), the code logs the failure and throws a TaskException whose message is the raw Jackson exception message.","triggerScenarios":"Called by initDmsHook during task init when parameters.getIsJsonFormat() is true and jsonData != null; objectMapper.readValue(jsonData, DmsParameters.class) throws JsonProcessingException because jsonData is not valid JSON or does not fit UpperCamelCaseStrategy DmsParameters fields.","commonSituations":"Hand-written jsonData with a trailing comma or single quotes; field names in snake_case when the mapper expects UpperCamelCase; using placeholder substitution that produced broken JSON; DmsParameters schema changed between DolphinScheduler versions making old jsonData incompatible.","solutions":["Validate jsonData in a JSON linter / the task's JSON editor before saving the workflow.","Match field names to the mapper's naming strategy (UpperCamelCaseStrategy) or fix to current DmsParameters schema.","Check for parameter placeholders (e.g. ${var}) whose substituted values break JSON escaping; escape quotes in the placeholder value.","Read the thrown message — it names the Jackson parse location (line/column) — and fix that exact spot."],"exampleFix":"// before\n\"jsonData\": \"{ReplicationTaskArn: 'arn:...'}\" // invalid JSON\n// after\n\"jsonData\": \"{\\\"ReplicationTaskArn\\\": \\\"arn:aws:dms:...\\\"}\"","handlingStrategy":"validation","validationCode":"// validate jsonData before enabling isJsonFormat\nObjectMapper m = JsonMapper.builder().propertyNamingStrategy(new PropertyNamingStrategy.UpperCamelCaseStrategy()).build();\nm.readTree(jsonData); // throws if malformed\nDmsParameters p = m.readValue(jsonData, DmsParameters.class); // throws if schema mismatch","typeGuard":null,"tryCatchPattern":"try {\n    convertJsonParameters();\n} catch (TaskException e) {\n    log.error(\"jsonData invalid, fix JSON syntax/field names: {}\", e.getMessage());\n}","preventionTips":["Lint jsonData with a JSON validator before saving the workflow node.","Remember the mapper uses UpperCamelCaseStrategy — name fields accordingly.","Escape quotes in substituted parameter placeholders that appear inside jsonData.","Re-validate jsonData after DolphinScheduler upgrades in case DmsParameters changed."],"tags":["jackson","json","task-params","aws-dms","parsing"],"backgroundTag":"json-parse-error","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}