Spring boot2.x 集成 druid-spring-boot-starter 报错

https://blog.csdn.net/qq_35170213/article/details/85779083

 

java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$PooledDataSourceConfiguration
....
Caused by: java.lang.IllegalStateException: Failed to introspect Class [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure] from ClassLoader [sun.misc.Launcher$AppClassLoader@58644d46]
....
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/autoconfigure/jdbc/metadata/DataSourcePoolMetadataProvider
....
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvider

Spring boot2.x 集成 druid-spring-boot-starter 报错

 

 

问题所在:
你的durid-spring-boot-starter中 自动配置类
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure依赖的DataSourcePoolMetadataProvider 以及在spring-boot-autoconfigure项目2.0以后删除掉了!

 

 

解决:
druid当然也升级了自己的 starter 了啊!你只需要升级到 1.1.10 即可!

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10 </version>
</dependency>


————————————————
版权声明:本文为CSDN博主「无需有太多」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_35170213/article/details/85779083

上一篇:SpringBoot入门案例


下一篇:SpringBoot源码分析----(二)SpringBoot自动配置原理