lix909
+N一米阳光
采纳率0%
2018-11-09 09:07

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

5

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条回答