SpringBoot集成Redis 启动报错
SpringBoot启动报错:Field redisTemplate in com.test.redis.controller.TestController required a bean of type ‘org.springframework.data.redis.core.RedisTemplate’ that could not be found.

报错信息:容器中没有找到RedisTemplate????按理说springboot应该帮我们注入了啊,赶紧看一眼自动配置类:RedisAutoConfiguration
SpringBoot集成Redis 启动报错
发现springboot确实帮我们注入了,但是泛型中定义的是RedisTemplate<Object, Object>

所以解决方法有啦
将注入的RedisTemplate改成下面这种形式
SpringBoot集成Redis 启动报错
顺利启动!!!!

相关文章:

  • 2021-10-10
  • 2021-08-27
  • 2021-12-01
  • 2021-08-15
  • 2021-05-28
  • 2018-10-04
猜你喜欢
  • 2021-04-18
  • 2021-08-13
  • 2021-07-26
  • 2021-09-15
  • 2021-08-20
  • 2019-10-31
  • 2019-08-14
相关资源
相似解决方案