apache / dubbo-spring-boot-project

Spring Boot Project for Apache Dubbo
https://dubbo.apache.org
Apache License 2.0
5.41k stars 1.88k forks source link

controller use @Reference throw NullPointerException #187

Closed MicroCountry closed 5 years ago

MicroCountry commented 6 years ago

controller use @Reference throw NullPointerException

image

1.add method in UserService 2.restart provider and consumer 3.consumer throw NullPointerException 4.restart provider ,than provider can run normal

sarins commented 6 years ago

@mercyblitz I got same error, can u please help for this?

mercyblitz commented 6 years ago

@sarins Did you get @Controller Bean too early?

sarins commented 6 years ago

@mercyblitz 我也不是很清楚,因为刚开始用这个anno的版本,用的是官方的starter 0.2.0版本,dubbo 2.6.2,Springboot 2.0.1,是否需要特殊的配置Springboot入口?求协助,跪谢

sarins commented 6 years ago

image

sarins commented 6 years ago

image

sarins commented 6 years ago

@mercyblitz Hi guy, can u please take a look this issue? Does this issue is same with issue #126? and does this issue was fixed? if not which version will fix this issue?

mercyblitz commented 5 years ago

Please add Dubbo 2.6.5 in order to override indirectly dependencies:

<dependency>
    <groupId>com.alibaba.boot</groupId>
    <artifactId>dubbo-spring-boot-starter</artifactId>
    <version>0.2.0</version>
</dependency>

<!-- Dubbo -->
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>dubbo</artifactId>
    <version>2.6.5</version>
</dependency>
<!-- Spring Context Extras -->
<dependency>
    <groupId>com.alibaba.spring</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>1.0.2</version>
</dependency>

There was a legacy issue in Dubbo.