解决BUG:java.lang.IllegalStateException: No CacheResolver specified, and no unique bean of type CacheM

BUG:

java.lang.IllegalStateException: No CacheResolver specified, and no unique bean of type CacheManager found. Mark one as primary (or give it the name ‘cacheManager’) or declare a specific CacheManager to use, that serves as the default one.
在这里插入图片描述

解决方法:两个cacheManager要再一个上面加@Primary

使用spring-data-redis自定义配置CacheManager,配了两个,启动报错。
报错堆栈翻译过来就是,要指定一个默认的,或者在所有使用的地方都指明用哪个cacheManager
采用@Primary指定一个常用的cacheManger比较好
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_45752941/article/details/112790356
今日推荐