同时出现多个Bean不知道如何选择

Parameter 0 of method cacheManager in com.qh.redis.config.RedisConfig required a single bean, but 2 were found:

当项目中生成两个bean时,进行注入无法去选择注入的对象,这时只要在生成的对象方法上面添加

@Primary

猜你喜欢

转载自blog.csdn.net/ke369093457/article/details/89678614