Spring boot 2.0 升级到 3.3.1 的相关问题 (五)

文章目录

Spring boot 2.0 升级到 3.3.1 的相关问题 (五)

druid 升级的问题

问题描述

1、配置无效的问题
druid-spring-boot-starter的自动配置不支持Spring boot 3.0版本的规则,自动配置无效。

2、druid 管理页面无法登录的问题

问题是因为druid的登录页面是用POST请求发送的Content-Type: application/x-www-form-urlencoded请求,而这个在Spring boot 2.4开始就不再默认支持处理,需要手动开启。

参考之前写的升级2.4.1版本的资料处理就可以了Spring boot 2.0.0 升级到 2.4.1 , POST 请求提交表单无法获取表单参数的问题

问题解决

替换druid-spring-boot-starterdruid-spring-boot-3-starter 依赖。

截止到2024年7月24日,当前最新版本为1.2.23 ,引入这个版本就可以了。

spring-data-redis 的变动问题

问题描述

1、配置不生效的问题。

问题调研

spring-boot-autoconfigure 3.3.1 版本修改了org.springframework.boot.autoconfigure.data.redis.RedisProperties,这个Properties的自动配置前缀为spring.data.redis ,原来为spring.redis

问题解决

Redis的配置的前缀更新为spring.data.redis

其他问题

引入spring.data.redis 后如果项目中有使用AOP 处理。比如AOP做的声明式事务、者启动了druid AOP 增强做的Service监控处理。就会出现大片的警告信息,类似于

复制代码
BeanPostProcessorChecker:Bean 'x' of type [y] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [projectingArgumentResolverBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.

虽然不影响实际的效果,并且问题点也很明确,但要解决起来还是比较麻烦,这个独立开一篇来处理。

相关推荐
焗猪扒饭8 小时前
redis stream用作消息队列极速入门
redis·后端·go
树獭非懒9 小时前
AI大模型小白手册|Embedding 与向量数据库
后端·python·llm
NE_STOP10 小时前
MyBatis-配置文件解读及MyBatis为何不用编写Mapper接口的实现类
java
IT_陈寒11 小时前
SpringBoot实战:5个让你的API性能翻倍的隐藏技巧
前端·人工智能·后端
梦想很大很大12 小时前
拒绝“盲猜式”调优:在 Go Gin 项目中落地 OpenTelemetry 链路追踪
运维·后端·go
唐叔在学习12 小时前
就算没有服务器,我照样能够同步数据
后端·python·程序员
用户685453759776913 小时前
同步成本换并行度:多线程、协程、分片、MapReduce 怎么选才不踩坑
后端
javaTodo13 小时前
Claude Code 记忆机制详解:从 CLAUDE.md 到 Auto Memory,六层体系全拆解
后端
LSTM9713 小时前
使用 C# 和 Spire.PDF 从 HTML 模板生成 PDF 的实用指南
后端