SpringBoot和redis集成的时候,错误记录
来源:互联网 发布:mac office好用吗 编辑:程序博客网 时间:2024/06/08 14:50
SpringBoot和redis集成的时候,CachingConfigurerSupport 的子类RedisConfig中,RedisConnectionFactory factory报错:
Could not autowire. No beans of 'RedisConnectionFactory' type found. less... (Ctrl+F1) Checks autowiring problems in a bean class.
运行项目后,日志文件显示错误信息是:
Description:Parameter 0 of method redisTemplate in cn.cqupt.teachresource.redis.RedisConfig required a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' that could not be found.Action:Consider defining a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' in your configuration.Process finished with exit code 0
最终发现是因为缺jedis的maven依赖。我们确保在maven依赖中有
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-redis</artifactId> <version>1.0.1.RELEASE</version></dependency>
然后再添加Jedis 依赖:
<dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.7.3</version></dependency>
这个答案是我在Stack Overflow 上找到的,所以在遇到问题的时候,还是多去Stack Overflow寻找下答案。
阅读全文
0 0
- SpringBoot和redis集成的时候,错误记录
- SpringBoot 集成redis和redisTemplate
- redis安装和安装时候的错误
- springBoot集成shiro+redis遇到的坑
- SpringBoot -- 集成Redis/CacheManager
- SpringBoot -- 集成Redis/CacheManager
- springboot集成redis
- springboot集成Redis
- springboot 集成redis 哨兵
- springboot集成Redis
- SpringBoot集成Redis
- springboot集成redis详解
- 关于SpringBoot 集成 Redis
- SpringBoot集成Redis
- springboot集成redis
- SpringBoot集成Redis
- SpringBoot集成Redis
- SpringBoot集成redis集群存储字符串和对象
- java static final 反思
- java并发-概述(1)
- 电路模型实验
- server.js文件配置
- 浅析通用Makefile
- SpringBoot和redis集成的时候,错误记录
- 使用AJAX传数组,后台接受数组
- 【GDI】绘制空心图形
- android自定义View学习4--图像剪切与变换
- Android各种获取Context方法
- 搜索系统18:lucene索引文件结构
- Ubuntu上的文件权限
- 从海航集团举办全球员工运动会了解海航怎么样
- gcc4.9.2源码编译