admin管理员组

文章数量:1794759

Consider defining a bean of type org.springframework.data.redis.connection.RedisConnectionFactory

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