dubbo2.5.1 版本 使用XML配置 报Caused by: java.lang.IllegalStateException: Duplicate monitor configs

发布于 2021-12-07 23:06:50 字数 5465 浏览 907 评论 0

dubbo2.5.1 版本 使用XML配置

报Caused by: java.lang.IllegalStateException: Duplicate monitor configs: <dubbo:monitor protocol="dubbo" id="com.alibaba.dubbo.config.MonitorConfig" />

 

XML 配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">

    <dubbo:protocol name="hessian" port="${hessian.protocol.port}" threads="1000" />
        
    <dubbo:registry protocol="${dubbo.registry.protocol}" address="${dubbo.registry.address}" />
    <dubbo:protocol name="${dubbo.protocol.name}" port="${dubbo.protocol.port}"  
        threadpool="${dubbo.protocol.threadpool}"  threads="${dubbo.protocol.threads}"  
        payload="${dubbo.protocol.payload:8388608}" accepts="${dubbo.protocol.accepts:0}" 
        dispatcher="${dubbo.protocol.dispatcher:all}" />
    <dubbo:monitor protocol="${dubbo.monitor.protocol:registry}" />
    <dubbo:application name="opcnet-icms-provider" />
    <dubbo:provider executes="${dubbo:provider.executes}" actives="${dubbo:provider.actives}" />

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mqAuditLogApi': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Duplicate monitor configs: <dubbo:monitor protocol="dubbo" id="com.alibaba.dubbo.config.MonitorConfig" /> and <dubbo:monitor protocol="dubbo" id="com.alibaba.dubbo.config.MonitorConfig" />
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1572)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:425)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:426)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:402)
    at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1053)
    at org.mule.config.spring.ServerNotificationManagerConfigurator.getMergedListeners(ServerNotificationManagerConfigurator.java:79)
    at org.mule.config.spring.ServerNotificationManagerConfigurator.getObject(ServerNotificationManagerConfigurator.java:61)
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
    ... 18 more
Caused by: java.lang.IllegalStateException: Duplicate monitor configs: <dubbo:monitor protocol="dubbo" id="com.alibaba.dubbo.config.MonitorConfig" /> and <dubbo:monitor protocol="dubbo" id="com.alibaba.dubbo.config.MonitorConfig" />
    at com.alibaba.dubbo.config.spring.ReferenceBean.afterPropertiesSet(ReferenceBean.java:157)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
    ... 31 more
2018-11-09 16:08:54,923 [bboShutdownHook] INFO                  AbstractConfig -  [DUBBO] Run shutdown hook now., dubbo version: 2.5.1, current host: 127.0.0.1
2018-11-09 16:08:54,925 [bboShutdownHook] INFO         AbstractRegistryFactory -  [DUBBO] Close all registries [], dubbo version: 2.5.1, current host: 127.0.0.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文