环境:spring boot+java8,spring版本为4以上
用spring boot 配置redis缓存时报错如下:
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.
有哪位大神有遇到类似异常信息的,可否提供解决方案?
spring boot 配置redis缓存
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
4条回答
- Robot-C 2016-04-28 11:34关注
使用redis做缓存的思路是在spring的项目中配置拦截器,在service层做切面,在findXXX或者getXXX等方法上进行拦截判断是否缓存即可。
1.环境:spring 3.1.2 + spring data redis 1.0.0+ jedis 2.1.0
2.spring配置文件配置:
<!-- jedis 配置 -->
<......
答案就在这里:redis spring缓存配置
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。解决 无用评论 打赏 举报
悬赏问题
- ¥25 关于##爬虫##的问题,如何解决?:
- ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
- ¥15 找一位技术过硬的游戏pj程序员
- ¥15 matlab生成电测深三层曲线模型代码
- ¥50 随机森林与房贷信用风险模型
- ¥50 buildozer打包kivy app失败
- ¥30 在vs2022里运行python代码
- ¥15 不同尺寸货物如何寻找合适的包装箱型谱
- ¥15 求解 yolo算法问题
- ¥15 虚拟机打包apk出现错误