service-security-provider应用有provider和consumer配置文件
其中secutrity-consumer引用两个服务
<dubbo:reference interface="cn.ce.best.member.service.KaUserService" id="kaUserService" init="true"/>
<dubbo:reference interface="cn.ce.best.member.service.KaMenuService" id="kaMenuService" init="true"/>
这两个服务是另一个应用service-member-provider提供的,代码如下
<dubbo:service interface="cn.ce.best.member.service.KaUserService" ref="kaUserService"/>
<dubbo:service interface="cn.ce.best.member.service.KaMenuService" ref="kaMenuService"/>
启动service-security-provider报如下错误(已排除serviceImpl 的id重复)
Caused by: java.lang.IllegalStateException: Duplicate spring bean id kaUserService
at com.alibaba.dubbo.config.spring.schema.DubboBeanDefinitionParser.parse(DubboBeanDefinitionParser.java:106)
at com.alibaba.dubbo.config.spring.schema.DubboBeanDefinitionParser.parse(DubboBeanDefinitionParser.java:77)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:185)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
... 23 more
我好像知道问题了 duobbo应用依赖其它应用服务时,是不是只需要depence api吧,我把实现类也depence进去乐,是不是冲突了?是因为我把其他提供服务的dubbo应用的实现类也依赖进工程里了,导致ID冲突