{"record":{"id":"477ee19c5c6ce935","repo":"alibaba/DataX","slug":"s-null-datax","errorCode":null,"errorMessage":"您提供的配置文件有误. 路径[%s]值为null，datax无法识别该配置. 请检查您的配置并作出修改.","messagePattern":"您提供的配置文件有误\\. 路径\\[(.+?)\\]值为null，datax无法识别该配置\\. 请检查您的配置并作出修改\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"common/src/main/java/com/alibaba/datax/common/util/Configuration.java","lineNumber":981,"sourceCode":"\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn target;\n\t}\n\n\t@SuppressWarnings(\"unchecked\")\n\tprivate Object findObjectInMap(final Object target, final String index) {\n\t\tboolean isMap = (target instanceof Map);\n\t\tif (!isMap) {\n\t\t\tthrow new IllegalArgumentException(String.format(\n\t\t\t\t\t\"您提供的配置文件有误. 路径[%s]需要配置Json格式的Map对象，但该节点发现实际类型是[%s]. 请检查您的配置并作出修改.\",\n\t\t\t\t\tindex, target.getClass().toString()));\n\t\t}\n\n\t\tObject result = ((Map<String, Object>) target).get(index);\n\t\tif (null == result) {\n\t\t\tthrow new IllegalArgumentException(String.format(\n\t\t\t\t\t\"您提供的配置文件有误. 路径[%s]值为null，datax无法识别该配置. 请检查您的配置并作出修改.\", index));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@SuppressWarnings({ \"unchecked\" })\n\tprivate Object findObjectInList(final Object target, final String each) {\n\t\tboolean isList = (target instanceof List);\n\t\tif (!isList) {\n\t\t\tthrow new IllegalArgumentException(String.format(\n\t\t\t\t\t\"您提供的配置文件有误. 路径[%s]需要配置Json格式的Map对象，但该节点发现实际类型是[%s]. 请检查您的配置并作出修改.\",\n\t\t\t\t\teach, target.getClass().toString()));\n\t\t}\n\n\t\tString index = each.replace(\"[\", \"\").replace(\"]\", \"\");\n\t\tif (!StringUtils.isNumeric(index)) {\n\t\t\tthrow new IllegalArgumentException(","sourceCodeStart":963,"sourceCodeEnd":999,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/common/src/main/java/com/alibaba/datax/common/util/Configuration.java#L963-L999","documentation":"Thrown by Configuration.findObjectInMap when the map at the current node exists but the requested key maps to null in the parsed configuration. DataX refuses to walk through explicit null values because subsequent segments would be meaningless; the error names the offending key. Note: this differs from a missing key (which returns a default) — it requires the key to be present with a JSON null value.","triggerScenarios":"Job json contains an explicit null for an intermediate key, e.g. {\"job\": {\"reader\": null}} and code calls get(\"job.reader.parameter.xxx\").","commonSituations":"Templated job configs where optional blocks were nulled out; YAML->JSON conversion emitting explicit nulls; user setting an unused section to null instead of deleting it.","solutions":["Delete the explicit null entries from the job json instead of leaving them as null","If the null is produced by a template engine, make it omit the key entirely","Only call get() with deep paths whose intermediate keys are guaranteed present"],"exampleFix":"// before\n{\"job\": {\"reader\": null, \"writer\": {...}}}\nconf.get(\"job.reader.parameter.username\"); // throws\n// after\n{\"job\": {\"writer\": {...}}}","handlingStrategy":"validation","validationCode":"// strip explicit nulls from the parsed config before deep access\nstatic void removeNulls(Map<String, Object> m) {\n    m.values().removeIf(Objects::isNull);\n    m.values().stream().filter(v -> v instanceof Map).forEach(v -> removeNulls((Map<String, Object>) v));\n}","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"值为null\")) {\n    // the named key holds JSON null: delete the key from the config and retry\n  }\n  throw e;\n}","preventionTips":["Never write explicit null blocks in job json; omit the key instead","Make template engines omit optional sections rather than emit null"],"tags":["datax","configuration","json","null-value"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}