若依框架升级springBoot3启动druid-spring-boot-starter报错问题及解决

如下:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method removeDruidFilterRegistrationBean in com.ruoyi.framework.config.DruidConfig required a bean of type 'com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties' that could not be found.


Action:

Consider defining a bean of type 'com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties' in your configuration.

原因

因为springBoot3 不是引入

1
2
3
4
5
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid-spring-boot-starter</artifactId>
    <version>你的版本号</version>
</dependency>

而是需要引入

1
2
3
4
5
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid-spring-boot-3-starter</artifactId>
    <version>1.2.24</version>
</dependency>

总结

以上为个人经验,希望能给大家一个参考.