整合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
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>
刷新下依赖试试 NoClassDefFoundError
如果是Spring整合的druid报错的话,去xml文件中检查数据源是否出错,
如果是SpringBoot 那就去yml文件看是不是配置错了。
检查一下依赖版本,以及完整性。实在不行把依赖删了,重新让Maven下载一份