admin管理员组文章数量:1794759
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注解自动装配。所有自动装配该接口的注解保持一致。
版权声明:本文标题:Java Consider marking one of the beans as @Primary问题解决 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686556628a81527.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论