baomidou / dynamic-datasource

dynamic datasource for springboot 多数据源 动态数据源 主从分离 读写分离 分布式事务
https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611
Apache License 2.0
4.67k stars 1.19k forks source link

数据源配置未生效 #77

Closed 1432362460 closed 5 years ago

1432362460 commented 5 years ago

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

huayanYu commented 5 years ago

仔细看和DRUID集成的文档