理工大学的菜鸡 2022-08-23 17:46 采纳率: 84.2%
浏览 38
已结题

整合druid连接池报错

问题遇到的现象和发生背景

整合druid连接池报错

问题相关代码,请勿粘贴截图
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘dataSource’: Unsatisfied dependency expressed through field ‘basicProperties’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties’: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/core/ConnectionCallback
  • 写回答

4条回答 默认 最新

  • CSDN专家-sinJack 2022-08-23 17:50
    关注

    UnsatisfiedDependencyException: Error creating bean with name ‘dataSource’:
    依赖问题,看下是否存在依赖冲突或者版本不一致问题。
    spring项目:

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid</artifactId>
         <version>1.2.9</version>
    </dependency>
    

    springboot项目:

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid-spring-boot-starter</artifactId>
        <version>1.1.14</version>
    </dependency>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(3条)

报告相同问题?

问题事件

  • 系统已结题 8月31日
  • 已采纳回答 8月23日
  • 创建了问题 8月23日

悬赏问题

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