{"record":{"id":"d41c88d8246e97ad","repo":"alibaba/nacos","slug":"103","errorCode":"103","errorMessage":"[MapperManager] Failed to find the table ,tableName: + tableName","messagePattern":"\\[MapperManager\\] Failed to find the table ,tableName: \\+ tableName","errorType":"error_code","errorClass":"NacosRuntimeException","httpStatus":null,"severity":"error","filePath":"plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/MapperManager.java","lineNumber":119,"sourceCode":"     * @return mapper.\n     */\n    public <R extends Mapper> R findMapper(String dataSource, String tableName) {\n        if (LOGGER.isDebugEnabled()) {\n            LOGGER.debug(\"[MapperManager] findMapper dataSource: {}, tableName: {}\", dataSource,\n                tableName);\n        }\n        if (StringUtils.isBlank(dataSource) || StringUtils.isBlank(tableName)) {\n            throw new NacosRuntimeException(FIND_DATASOURCE_ERROR_CODE,\n                \"dataSource or tableName is null\");\n        }\n        Map<String, Mapper> tableMapper = MAPPER_SPI_MAP.get(dataSource);\n        if (Objects.isNull(tableMapper)) {\n            throw new NacosRuntimeException(FIND_DATASOURCE_ERROR_CODE,\n                \"[MapperManager] Failed to find the datasource,dataSource:\" + dataSource);\n        }\n        Mapper mapper = tableMapper.get(tableName);\n        if (Objects.isNull(mapper)) {\n            throw new NacosRuntimeException(FIND_TABLE_ERROR_CODE,\n                \"[MapperManager] Failed to find the table ,tableName:\" + tableName);\n        }\n        if (dataSourceLogEnable) {\n            return MapperProxy.createSingleProxy(mapper);\n        }\n        return (R) mapper;\n    }\n    \n    /**\n     * Get all mappers.\n     *\n     * @return unmodifiable map of all mappers\n     */\n    public Map<String, Map<String, Mapper>> getAllMappers() {\n        return Collections.unmodifiableMap(MAPPER_SPI_MAP);\n    }\n}\n","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/MapperManager.java#L101-L137","documentation":"Thrown by MapperManager.findMapper as NacosRuntimeException with code FIND_TABLE_ERROR_CODE (103) when the dataSource is registered but the requested tableName is not present in that datasource's table->Mapper map. The dialect plugin loaded but has no Mapper for this specific table.","triggerScenarios":"Calling findMapper with a valid dataSource and a tableName for which no Mapper implementation exists in that datasource's registered set (e.g. a custom table or a table unsupported by the dialect plugin).","commonSituations":"Querying a table not modeled by the datasource plugin; version mismatch where a newer table is requested against an older plugin; custom tables added without a corresponding Mapper SPI.","solutions":["Confirm the tableName is one the datasource plugin models; consult the plugin's mapper list.","Upgrade the datasource plugin to a version that includes a Mapper for the requested table.","If the table is custom, provide a Mapper implementation and register it via SPI."],"exampleFix":"// before\nmapperManager.findMapper(\"mysql\", \"my_custom_table\"); // -> 103 table\n\n// after: implement + register a Mapper for the custom table\npublic class MyCustomTableMapperByMysql extends AbstractMapper {\n    @Override public String getTableName() { return \"my_custom_table\"; }\n    // ... column/methods\n}\n// add to META-INF/services com.alibaba.nacos.plugin.datasource.Mapper","handlingStrategy":"try-catch","validationCode":"// verify a mapper exists for the table in this datasource\nMap<String, Mapper> tables = mapperManager.getAllMappers().get(dataSource);\nboolean ok = tables != null && tables.containsKey(tableName);","typeGuard":"static boolean tableHasMapper(MapperManager mm, String ds, String table) {\n    Map<String, Mapper> t = mm.getAllMappers().get(ds);\n    return t != null && t.containsKey(table);\n}","tryCatchPattern":"try {\n    return mapperManager.findMapper(ds, table);\n} catch (NacosRuntimeException e) {\n    if (e.getCode() == FIND_TABLE_ERROR_CODE) {\n        // upgrade dialect plugin or add a custom Mapper\n    }\n    throw e;\n}","preventionTips":["Use table names modeled by the installed dialect plugin.","Upgrade the plugin when new tables are introduced.","For custom tables, implement and SPI-register a Mapper."],"tags":["plugin","datasource","mapper","table","not-found"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}