Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.


***************************
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.

Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.

點擊查看大圖

通過上面的Description信息可以看出來,報錯在UserServiceImpl 中,具體UserServiceImpl 代碼如下圖所示:

Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.

解決方案:

RedisTemplate<String, List> redisTemplate 的注解 @Autowired 更換為 @Resource

再次運行,問題搞定。

你可能感興趣的文章:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM