java

关注公众号 jb51net

关闭
首页 > 软件编程 > java > 若依框架升级springBoot3启动druid-spring-boot-starter报错

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

作者:码农-胖虎

文章主要描述了在使用Spring Boot 3时,由于缺少`com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties`类型的bean而报错,解决方案是考虑在配置中定义该类型bean

报错信息

如下:

***************************
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 不是引入

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

而是需要引入

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

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:
阅读全文