Spring boot 整合dubbo 解决@Reference 注解为null情况

本文介绍了在Spring Boot 2.x中遇到的@Reference注解为null的问题,建议使用1.5.9版本的Spring Boot。详细探讨了可能的原因,包括服务提供者配置错误和Zookeeper注册地址不正确。提供了两种非正规解决方案:使用XML配置和直连模式,并给出了官方示例链接及提供者和消费者代码示例。
摘要由CSDN通过智能技术生成

首先检查一下你的spring boot版本是多少?

如果是2.X 不用看了,spring boot 2.x 必定会出现这个问题,

改为 1.5.9 或其他1.x版本,目前生产环境建议使用1.x版本。

   <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

建议dubbo依赖:

        <dependency>
            <groupId>io.dubbo.springboot</groupId>
            <artifactId>spring-boot-starter-dubbo</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.101tec</groupId>
            <artifactId>zkclient<
  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值