{"record":{"id":"0fd5e1789fc63dea","repo":"alibaba/canal","slug":"dbmapping-targettable-0fd5e1","errorCode":null,"errorMessage":"dbMapping.targetTable","messagePattern":"dbMapping\\.targetTable","errorType":"validation","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"client-adapter/tablestore/src/main/java/com/alibaba/otter/canal/client/adapter/tablestore/config/MappingConfig.java","lineNumber":104,"sourceCode":"    }\n\n    public Integer getThreads() {\n        return threads;\n    }\n\n    public void setThreads(Integer threads) {\n        this.threads = threads;\n    }\n\n    public void validate() {\n        if (dbMapping.database == null || dbMapping.database.isEmpty()) {\n            throw new NullPointerException(\"dbMapping.database\");\n        }\n        if (dbMapping.table == null || dbMapping.table.isEmpty()) {\n            throw new NullPointerException(\"dbMapping.table\");\n        }\n        if (dbMapping.targetTable == null || dbMapping.targetTable.isEmpty()) {\n            throw new NullPointerException(\"dbMapping.targetTable\");\n        }\n    }\n\n\n\n\n    public static class ColumnItem {\n        private String targetColumn;\n        private String  column;\n        private TablestoreFieldType type;\n\n        public String getColumn() {\n            return column;\n        }\n\n        public void setColumn(String column) {\n            this.column = column;\n        }","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client-adapter/tablestore/src/main/java/com/alibaba/otter/canal/client/adapter/tablestore/config/MappingConfig.java#L86-L122","documentation":"Thrown by MappingConfig.validate() when dbMapping.targetTable is null or empty. This identifies the destination table name in Alibaba Tablestore (OTS). It is the third and final check in validate() — thrown only after database and table pass.","triggerScenarios":"Loading a tablestore mapping config YAML where the dbMapping.targetTable field is absent, null, or an empty string.","commonSituations":"YAML file missing the `targetTable:` line; OTS table name was not provisioned yet when the config was written; indentation error; the config was partially filled and deployed prematurely.","solutions":["Add a non-empty `targetTable` value (the OTS table name) under dbMapping.","Ensure the OTS table has been created in the Tablestore instance before deploying the config."],"exampleFix":"// before\ndbMapping:\n  database: mydb\n  table: users\n\n// after\ndbMapping:\n  database: mydb\n  table: users\n  targetTable: ots_users","handlingStrategy":"validation","validationCode":"// Check dbMapping.targetTable before calling validate()\nif (config.getDbMapping() == null\n    || config.getDbMapping().getTargetTable() == null\n    || config.getDbMapping().getTargetTable().isEmpty()) {\n    throw new IllegalArgumentException(\"dbMapping.targetTable is required and must not be empty\");\n}","typeGuard":"null","tryCatchPattern":"try {\n    config.validate();\n} catch (NullPointerException e) {\n    if (\"dbMapping.targetTable\".equals(e.getMessage())) {\n        logger.error(\"Missing required field: dbMapping.targetTable\");\n    }\n    throw e;\n}","preventionTips":["Always include a non-empty `targetTable` (OTS table name) under dbMapping.","Verify the OTS table exists in the Tablestore instance before deploying the config.","Add a pre-deploy validation step that checks all three required fields."],"tags":["tablestore-adapter","config-validation","required-field","config-error"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}