Java Consider marking one of the beans as @Primary问题解决
问题描述:
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
问题分析:
1、使用@Autowired自动装配的接口在另外一个定义的地方使用了Dubbo的@Reference,导致了该接口有两个不同的实现类报错。
解决办法:
自动装配的接口是项目里面的,使用@Autowired注解自动装配。自动装配的接口是其他微服务的,使用@Reference注解自动装配。所有自动装配该接口的注解保持一致。
还没有评论,来说两句吧...