Parameter 0 of method cacheManager in com.qh.redis.config.RedisConfig required a single bean, but 2 were found:
當項目中生成兩個bean時,進行注入無法去選擇注入的對象,這時只要在生成的對象方法上面添加
@Primary
Parameter 0 of method cacheManager in com.qh.redis.config.RedisConfig required a single bean, but 2 were found:
當項目中生成兩個bean時,進行注入無法去選擇注入的對象,這時只要在生成的對象方法上面添加
@Primary
Spring boot 配置數據源 spring: mvc: favicon: enabled: false datasource: primary: username: root