zoukankan      html  css  js  c++  java
  • dubbo spring bean id冲突

    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冲突
  • 相关阅读:
    JavaScript对象 原型
    JavaScript数据类型 数据转换
    JavaScript字符串去除空格
    JavaScript实现StringBuffer
    JavaScript获取url参数
    JavaScript获取当前根目录
    React 和 Redux理解
    Umbraco 中获取一个media item的文件路径 file path
    Umbraco中获取UmbracoContext
    Umbraco中如何找到home node
  • 原文地址:https://www.cnblogs.com/shenzhichipingguo/p/9257362.html
Copyright © 2011-2022 走看看