*************************** APPLICATION FAILED TO START *************************** Description: Field redisTemplate in com.demo.service.UserServiceImpl required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found. - Bean method 'stringRedisTemplate' in 'RedisAutoConfiguration' not loaded because @ConditionalOnMissingBean (types: org.springframework.data.redis.core.StringRedisTemplate; SearchStrategy: all) found beans of type 'org.springframework.data.redis.core.StringRedisTemplate' template Action: Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redis.core.RedisTemplate' in your configuration.
通過上面的Description信息可以看出來,報錯在UserServiceImpl 中,具體UserServiceImpl 代碼如下圖所示:
解決方案:
將 RedisTemplate<String, List> redisTemplate
的注解 @Autowired
更換為 @Resource
再次運行,問題搞定。
你可能感興趣的文章: