{"record":{"id":"925b16b13d639c77","repo":"apache/incubator-seata","slug":"the-s-can-t-be-empty","errorCode":null,"errorMessage":"the {%s} can't be empty","messagePattern":"the (.+?) can't be empty","errorType":"exception","errorClass":"StoreException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java","lineNumber":147,"sourceCode":"\n    /**\n     * Get db type db type.\n     *\n     * @return the db type\n     */\n    protected DBType getDBType() {\n        return DBType.valueof(CONFIG.getConfig(ConfigurationKeys.STORE_DB_TYPE));\n    }\n\n    /**\n     * get db driver class name\n     *\n     * @return the db driver class name\n     */\n    protected String getDriverClassName() {\n        String driverClassName = CONFIG.getConfig(ConfigurationKeys.STORE_DB_DRIVER_CLASS_NAME);\n        if (StringUtils.isBlank(driverClassName)) {\n            throw new StoreException(\n                    String.format(\"the {%s} can't be empty\", ConfigurationKeys.STORE_DB_DRIVER_CLASS_NAME));\n        }\n        return driverClassName;\n    }\n\n    /**\n     * get db max wait\n     *\n     * @return the db max wait\n     */\n    protected Long getMaxWait() {\n        return CONFIG.getLong(ConfigurationKeys.STORE_DB_MAX_WAIT, DEFAULT_DB_MAX_WAIT);\n    }\n\n    protected ClassLoader getDriverClassLoader() {\n        return DRIVER_LOADERS.getOrDefault(getDriverClassName(), this.getClass().getClassLoader());\n    }\n","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java#L129-L165","documentation":"AbstractDataSourceProvider.getDriverClassName() reads config key store.db.driver-class-name (ConfigurationKeys.STORE_DB_DRIVER_CLASS_NAME); if the value is blank it throws StoreException naming the key with 'the {store.db.driver-class-name} can't be empty'. This is a hard prerequisite check before any DataSource for store mode db can be built.","triggerScenarios":"store.mode=db configured on the server (or a DataSourceProvider used by a client/embedded component) while store.db.driver-class-name is missing, empty, or whitespace in file.conf/application.yml/registry config.","commonSituations":"Switching store.mode from file to db but only setting url/user/password; config keys misspelled or nested under the wrong block after a 1.x->2.x conf migration; YAML indentation putting the key outside the store.db section.","solutions":["Set the key in the server config: e.g. `store.db.driver-class-name: com.mysql.cj.jdbc.Driver` (match your DB: org.postgresql.Driver, oracle.jdbc.driver.OracleDriver, etc.).","Check YAML indentation / file.conf block so the key truly sits under store.db.","Confirm the other mandatory store.db keys (url, user; and usually password) are also set to avoid the follow-up 'can't be empty' errors.","If you did not intend DB storage, set store.mode back to file (or db+raft where applicable) so the provider is not invoked."],"exampleFix":"# before (application.yml)\nseata:\n  store:\n    mode: db\n    db:\n      url: jdbc:mysql://...   # driver-class-name missing -> StoreException\n\n# after\nseata:\n  store:\n    mode: db\n    db:\n      driver-class-name: com.mysql.cj.jdbc.Driver\n      url: jdbc:mysql://127.0.0.1:3306/seata\n      user: seata\n      password: seata","handlingStrategy":"validation","validationCode":"// startup config validation\nString driver = seataConfig.get(\"store.db.driver-class-name\");\nif (storeMode.equals(\"db\") && (driver == null || driver.trim().isEmpty())) {\n    throw new ConfigurationException(\"store.db.driver-class-name is required when store.mode=db\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    dataSourceProvider.generate();\n} catch (StoreException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"can't be empty\")) {\n        throw new ConfigurationException(\"Missing mandatory store.db key: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Validate the full store.db block (driver-class-name, url, user) at startup, not at first SQL.","Use the official config template as the base and diff your changes.","Fail fast in staging so missing keys never reach production."],"tags":["configuration","store","jdbc","datasource","validation"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}