Expected Result: 启动项目报错
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Invocation of init method failed; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$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 (no profiles are currently active).
Enviroment
JDK Version(required): 1.8
SpringBoot Version(required): 1.5.1
Starter Version(required): 2.5.5
Describe
请问,只需要在yml文件中,如文档所示例配置,使用@DS区分,就可以了吗?但是,我按照官方文档上配置根本启动不了项目,我看百度上还有aop配置动态数据源等一大堆配置,是否真的还需要其他配置?
Expected Result: 启动项目报错 Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Invocation of init method failed; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$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 (no profiles are currently active).
Actual Result:
Steps to reproduce
Step 1 yml文件中配置 spring: datasource: dynamic: primary: master #设置默认的数据源或者数据源组,默认值即为master datasource: master: username: root password: 123456 driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://xx.xx.xx.xx:3306/dynamic slave_1: username: root password: 123456 driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://xx.xx.xx.xx:3307/dynamic
Step 2
Step 3