
Consider defining a bean of type org.springframework.data.redis.connection.RedisConnectionFactory
Consider defining a bean of type ‘org.springframework.data.redis.core.RedisTemplate’ in your configuration 代码如下: springboot 整合redis是爆出的错误,找不到RedisTemplate 配置 解决方法: 1、检查依赖是否导入
<dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-redis</artifactId> </dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency>2.检查是否配置了属性文件
host: 127.0.01 port: 6379 password: database: 0 如果没有配置redis会调用默认的配置3.如果以上两步还没有解决问题 尝试把注解修改成@Resource @Resource private RedisTemplate<String, Object> redisTemplate;
4.如果还没有解决问题 尝试修改下pom.xml 中 springboot的版本 org.springframework.boot spring-boot-starter-parent 1.5.17.RELEASE 以上解决方式仅供参考,如果有更好的解决方式 可以留言
👁️ 阅读量:0
© 版权声明:本文《Consider defining a bean of type org.springframework.data.redis.connection.RedisConnectionFactory》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686552633a289985.html。