From 193876c856cda511f1f94d61db298802613b46b1 Mon Sep 17 00:00:00 2001 From: smartscity Date: Sat, 31 Aug 2024 22:46:00 +0800 Subject: [PATCH] optimize: optimize database driver cannot found message (#6800) --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 1 + .../apache/seata/core/store/db/AbstractDataSourceProvider.java | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index a779856f936..c9f2104ac43 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -29,6 +29,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#6765](https://github.com/apache/incubator-seata/pull/6765)] fix MySQL driver loading by replacing custom classloader with system classloader for better compatibility and simplified process - [[#6781](https://github.com/apache/incubator-seata/pull/6781)] the issue where the TC occasionally fails to go offline from the NamingServer - [[#6797](https://github.com/apache/incubator-seata/pull/6797)] fall back to any of available cluster address when query cluster address is empty +- [[#6800](https://github.com/apache/incubator-seata/pull/6800)] make exception message generic for all database drivers ### optimize: diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index a915329758b..ad9ee8da648 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -30,6 +30,7 @@ - [[#6765](https://github.com/apache/incubator-seata/pull/6765)] 改进MySQL驱动加载机制,将自定义类加载器替换为系统类加载器,更兼容简化流程 - [[#6781](https://github.com/apache/incubator-seata/pull/6781)] 修复tc下线时,由于定时任务没有先关闭,导致下线后还会被注册上,需要靠namingserver的健康检查来下线的bug - [[#6797](https://github.com/apache/incubator-seata/pull/6797)] 当查询的集群地址为空时,获取可用的任意集群地址 +- [[#6800](https://github.com/apache/incubator-seata/pull/6800)] 使异常消息对所有数据库驱动程序通用 ### optimize: diff --git a/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java b/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java index 9cca970ea69..c11a55f0979 100644 --- a/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java +++ b/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java @@ -80,7 +80,7 @@ public void validate() { driverClassPath = folderPath + "/jdbc/"; } throw new StoreException(String.format( - "the {%s} can't be found in the path %s, please copy database driver dependencies, such as `mysql-connector-java.jar` to the path.", driverClassName, driverClassPath)); + "The driver {%s} cannot be found in the path %s. Please ensure that the appropriate database driver dependencies are included in the classpath.", driverClassName, driverClassPath)); } }