第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Spring boot使用Redis時,報錯,有redisTemplate和stringRedisTemplate兩個bean?

Spring boot使用Redis時,報錯,有redisTemplate和stringRedisTemplate兩個bean?

繁華開滿天機 2019-03-01 11:03:05
代碼在之前的工程中是好使的,新工程升了Springboot 版本,redis依賴從spring-boot-start-redis變成了spring-boot-start-data-redis,就顯示有兩個bean沖突,使用@Qualifier()注解指定一個后還是報一樣的錯誤,求解。 Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2017-05-13 20:11:30.651 ERROR 1869 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Parameter 0 of method setRedis in cn.andhub.authorization.manager.impl.RedisTokenManager required a single bean, but 2 were found: - redisTemplate: defined by method 'redisTemplate' in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration$RedisConfiguration.class] - stringRedisTemplate: defined by method 'stringRedisTemplate' in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration$RedisConfiguration.class] Action: Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
查看完整描述

4 回答

?
斯蒂芬大帝

TA貢獻(xiàn)1827條經(jīng)驗 獲得超8個贊

兄臺,最后解決了嗎?我也遇到了 一樣一樣的

查看完整回答
反對 回復(fù) 2019-03-01
?
慕容3067478

TA貢獻(xiàn)1773條經(jīng)驗 獲得超3個贊

我今天也遇到了這個問題,后來發(fā)現(xiàn)是我把變量名寫錯了。
正確的:
@Autowired
private RedisTemplate redisTemplate;
錯誤的:
@Autowired
private RedisTemplate redistemplate;
把T寫成小寫的了。
后改成大寫就項目啟動正常了。。。

查看完整回答
反對 回復(fù) 2019-03-01
  • 4 回答
  • 0 關(guān)注
  • 819 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號