No CacheResolver specified, and no unique bean of type CacheManager found

学习spring boot 时整合了redis再整合ehcahe是报No CacheResolver specified, and no unique bean of type CacheManager found的错,CacheManager 不唯一,各种百度之后发现是要在一个CacheManager 上加上@Primary.于是就在RedisConfig 类里面的

@Primary

@Bean
public CacheManager cacheManager(@SuppressWarnings("rawtypes") RedisTemplate  redisTemplate){
RedisCacheManager rcm = new RedisCacheManager(redisTemplate);
//设置缓存过期时间
        //rcm.setDefaultExpiration(60);//秒
        return rcm;

}

加上@Primary 错误解决.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
当出现"make: *** No targets specified and no makefile found. Stop."这样的错误提示时,通常是因为make命令找不到Makefile文件。Makefile文件是用来告诉make命令如何编译和链接程序的配置文件。解决这个问题的方法有两种。 第一种方法是检查当前目录下是否存在Makefile文件。如果不存在,可以尝试在当前目录下执行"./configure"命令,这个命令会生成Makefile文件。生成Makefile文件后,再执行"make"命令即可正常运行。这种方法适用于源码安装的情况。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [make 命令出现:"make:*** No targets specified and no makefile found.Stop.](https://blog.csdn.net/shun35/article/details/94576800)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [make: *** No targets specified and no makefile found. Stop.错误解决办法](https://blog.csdn.net/weiyangdong/article/details/79203712)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值