首先检查一下你的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</artifactId>
<ver

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





