abbott_001 2021-12-23 15:21 采纳率: 42.9%
浏览 44
已结题

springboot+maven dynamic-datasource 动态切换数据源,启动报错

遇到问题
Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

  • 写回答

3条回答 默认 最新

  • abbott_001 2021-12-24 16:12
    关注

    已解决,
    解决方法:启动类@SpringBootApplication(exclude= {DruidDataSourceAutoConfigure.class}),注意是DruidDataSourceAutoConfigure,不是DataSourceAutoConfiguration.class

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 1月12日
  • 已采纳回答 1月4日
  • 修改了问题 12月23日
  • 创建了问题 12月23日

悬赏问题

  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码