You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "leapcat (GitHub)" <gi...@apache.org> on 2020/03/26 10:41:39 UTC

[GitHub] [dubbo-spring-boot-project] leapcat opened issue #685: Dubbo2.7.5: Duplicate ServiceBean found

DUBBO版本:2.7.5
问题描述:使用DUBBO-Samples中的org.apache.dubbo.spring.boot.demo.provider进行测试。一个接口有2个实现类,分别使用@Service(group="")来暴露服务。启动时ConfigManger认为2个Service的id是一样的,从日志看确实都是"org.apache.dubbo.spring.boot.demo.consumer.DemoService"。日志请看下面。造成的后果是:注册中心(NACOS)中只有一个服务注册上去。此问题在2.7.3版本不存在,我比较了2个版本的ConfigManager,新版本增加了checkDuplicate功能。
尝试解决:(1)降低到2.7.3版本,问题解决;(2)继续2.7.5版本,使用@Service(provider="s1"),来区别两个ServiceBean的ID,又报了其他的错误。 请帮忙解决一下。

用法:
`
@Service(group="s1", version = "1.0.0")
public class DefaultDemoService implements DemoService {}

@Service(group="s2", version = "1.0.0")
public class DefaultDemoService2 implements DemoService {}
`
日志:
`
2020-03-26 18:34:04.195  WARN 12596 --- [           main] o.a.dubbo.config.context.ConfigManager   :  [DUBBO] Duplicate ServiceBean found, there already has one default ServiceBean or more than two ServiceBeans have the same id, you can try to give each ServiceBean a different id : <dubbo:service beanName="ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s2" exported="false" unexported="false" ref="org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService2@abf688e" prefix="dubbo.service.org.apache.dubbo.spring.boot.demo.consumer.DemoService" uniqueServiceName="s2/org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0" interface="org.apache.dubbo.spring.boot.demo.consumer.DemoService" dynamic="true" version="1.0.0" deprecated="false" group="s2" id="org.apache.dubbo.spring.boot.demo.consumer.DemoService" valid="true" />, dubbo version: 2.7.5, current host: 30.27.186.2
`

[ Full content available at: https://github.com/apache/dubbo-spring-boot-project/issues/685 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org