admin管理员组文章数量:1794759
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 以上解决方式仅供参考,如果有更好的解决方式 可以留言
本文标签: typeorgdefiningbeanspringframework
版权声明:本文标题:Consider defining a bean of type org.springframework.data.redis.connection.RedisConnectionFactory 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686552414a81039.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论