You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Jc826 (GitHub)" <gi...@apache.org> on 2018/11/14 05:03:54 UTC

[GitHub] [incubator-dubbo-spring-boot-project] Jc826 commented on issue #288: 消费方使用拦截器,导致@Reference 注入为null

> dubbo消费方,使用了拦截器,且group为`Constants.CONSUMER`时,会导致`@Reference`注解注入失败.此时消费方调用提供方时,demoService为null,抛出空指针异常.
> 
> ```java
> @Activate(group = {Constants.CONSUMER})
> public class DubboFilter implements Filter{
> 
> }
> ```
> 
> ```java
> @Reference(version = "${dubbo.service.version}")
> private DemoService demoService;
> ```
> 
> 目前只发现这种情况有问题
> 
> 1. 先启动的provider,然后启动的consumer
> 2. 使用了拦截器才会有问题
> 3. 使用`Constants.PROVIDER`的拦截器可以正常使用.
> 4. 消费方不使用此拦截器的时候,`@Reference`注解可以正常注入
> 5. 提供方拦截器是正常使用的

@Reference(check=false)

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/288 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org