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

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}" />
    <!-- <dubbo:application name="${dubbo.application.owner}" /> -->

报错日志:

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

当 配置去除后程序正常启动

1个回答

lix909
+N一米阳光 不是找不到服务,而是服务启动不起来报错:Duplicate monitor configs: <dubbo:monitor protocol="dubbo" id="com.alibaba.dubbo.config.MonitorConfig" /> and <dubbo:monitor protocol="dubbo" id="com.alibaba.dubbo.config.MonitorConfig" />
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐