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

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

Jc826 commented on issue #288: 消费方使用拦截器,导致@Reference 注入为null
URL: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/288#issuecomment-438538644
 
 
   > 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)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org