dubbo應用既當提供者又當消費者java.lang.IllegalStateException: Duplicate application configs
阿新 • • 發佈:2018-04-02
AR def 原因 art ati tee nco tail name
一個dubbo的應用啟動時報錯:java.lang.IllegalStateException: Duplicate application configs。原因如下:
當一個應用既當提供者和消費者時,必定會分別配置應用的名稱:
提供者:
[html]
- <dubbo:application name="XXXX" />
消費者:
[html]
- <bean id="dubbo_application" class="com.alibaba.dubbo.config.ApplicationConfig">
- <property name="name" value="XXX"/>
- </bean>
這時啟動應用時就會抱錯:
java.lang.IllegalStateException: Duplicate application configs: <dubbo:application name="XXX" id="XXX" /> and <dubbo:application name="XXXX" id="XXXX" />
解決方法是:
[html]
- <bean id="dubbo_application" default="false" class="com.alibaba.dubbo.config.ApplicationConfig">
- <property name="name" value="XXX"/>
- </bean>
dubbo應用既當提供者又當消費者java.lang.IllegalStateException: Duplicate application configs