MultiCast注册中心Q(Dubbo),消费者启动报错

生产者配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:p="http://www.springframework.org/schema/p"
       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.xsd
		                   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

    <dubbo:application name="webserver"/>

    <bean id="sayHelloImpl" class="com.sdp.dubbo.MyTest.SayHelloImpl"></bean>
    <!--使用注册中心的dubbo-->
    <!--这里我们就定义了一个注册中信,MultiCase该注册中心不需要加入任何jar包,但是该注册中心用的很少,不会在实际项目的开发中使用该注册市中心,
        一般情况下,我们都会使用在软件开发的测试阶段使用该注册中中心,需要注意的是,该注册中心的访问是使用IP+端口,IP应在244.0.0.0~239.255.255.255
        之间,端口的话,你就自己指定就行了,但是不能发生端口冲突的情况。
        可以看出在这里使用了multicase协议访问
    -->
    <dubbo:registry address="multicast://224.2.3.4:45678"/>
    
    
    <!--将生产者的劳动成功注册到MultiCast注册中心-->
    <dubbo:service interface="com.sdp.dubbo.MyTest.SayHello" ref ="sayHelloImpl"/>

</beans>

消费者的配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:p="http://www.springframework.org/schema/p"
       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.xsd
		                   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

    <dubbo:application name="webcustom"/>

    <!--在消费者端注册注册中心,是为了从注册中心中拿取由生产者提供的功能(接口吧!)-->
    <dubbo:registry address="multicast://224.2.3.4:45678"/>

    <dubbo:reference  id ="sayHello" interface="com.sdp.dubbo.MyTest.SayHello"/>

</beans>

 

 

启动时报错如下:

 

 我的解决方案:

关闭虚拟网卡!

 

如果你的计算机装了vmware或者其它虚拟机软件,那么就很容易造成虚拟网卡混乱,笔者也不是很懂虚拟网卡,所以,我们直接将虚拟网卡关闭,即可。

 

步骤如下:

右击,我的电脑,点击 ————>管理   出现如下界面

 

 

 

 以上是个人经验所得,希望对大家能有帮助!(修改完别忘了重启生产者0.0)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值