Caused by: $DataSourceBeanCreationEx...

时间:2025-02-11 22:45:12
 1 Caused by: $DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (the profiles "local" are currently active).
 2     at (:247)
 3     at (:184)
 4     at (:42)
 5     at $(:56)
 6     at .invoke0(Native Method)
 7     at (:62)
 8     at (:43)
 9     at (:498)
10     at (:162)
11     ... 116 common frames omitted

报错原因:项目的中,config-server没有配置正确(如下14行):应该配置为config-server的名字,我配置成了项目名称

 1 spring:
 2   profiles:
 3     active: local
 4   application:
 5     name: xxx-server
 6   cloud:
 7     config:       
 8       name: ${}
 9       profile: ${:dev}
10       username: ${}
11       password: ${}
12       discovery:
13         enabled: true #使用服务发现组件中的Config Server,默认false
14         service-id: config-server  #Config Server的名字,默认configserver