service-security-provider應用有provider和consumer配置文件java
其中secutrity-consumer引用兩個服務spring
<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提供的,代碼以下api
<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重複)app
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衝突