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 2022/11/18 11:18:40 UTC

[GitHub] [dubbo] JavaLionLi opened a new issue, #10959: isConsumerSide 报 null 问题

JavaLionLi opened a new issue, #10959:
URL: https://github.com/apache/dubbo/issues/10959

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.1.2
   * Operating System version: linux
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   之前用的3.1.1提过一次了 让我升级3.1.2 升级之后还是有问题
   https://github.com/apache/dubbo/issues/10704
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   
   If there is an exception, please attach the exception trace:
   
   ```
   Just put your stack trace here!
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [dubbo] AlbumenJ commented on issue #10959: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10959:
URL: https://github.com/apache/dubbo/issues/10959#issuecomment-1321518696

   > > 之前修复是在 3.0 分支做的,发版的时候没有合并到新分支。 这个已经修复 [ae0a371](https://github.com/apache/dubbo/commit/ae0a371690546ce859f2041814f76dad2c710fd9)
   > > 对应的集成测试用例已经完善,[https://github.com/apache/dubbo-samples/pull/586。](https://github.com/apache/dubbo-samples/pull/586%E3%80%82)
   > 
   > 那现在应该怎么办 等着发布3.1.3嘛
   
   3.1.3 本周会发布,此外的可以配置 scope=remote 使用远程调用避免


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [dubbo] ChinaDavidWW commented on issue #10959: isConsumerSide 报 null 问题

Posted by "ChinaDavidWW (via GitHub)" <gi...@apache.org>.
ChinaDavidWW commented on issue #10959:
URL: https://github.com/apache/dubbo/issues/10959#issuecomment-1612354041

   到底是怎么回事。俺也不懂


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [dubbo] JavaLionLi commented on issue #10959: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10959:
URL: https://github.com/apache/dubbo/issues/10959#issuecomment-1321491431

   > 之前修复是在 3.0 分支做的,发版的时候没有合并到新分支。 这个已经修复 [ae0a371](https://github.com/apache/dubbo/commit/ae0a371690546ce859f2041814f76dad2c710fd9)
   > 
   > 对应的集成测试用例已经完善,[https://github.com/apache/dubbo-samples/pull/586。](https://github.com/apache/dubbo-samples/pull/586%E3%80%82)
   
   那现在应该怎么办 等着发布3.1.3嘛


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [dubbo] JavaLionLi closed issue #10959: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi closed issue #10959: isConsumerSide 报 null 问题
URL: https://github.com/apache/dubbo/issues/10959


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [dubbo] JavaLionLi commented on issue #10959: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10959:
URL: https://github.com/apache/dubbo/issues/10959#issuecomment-1319869284

   https://github.com/apache/dubbo/issues/10704


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [dubbo] AlbumenJ commented on issue #10959: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10959:
URL: https://github.com/apache/dubbo/issues/10959#issuecomment-1359509378

   > @AlbumenJ 这个问题任然存在 (3.1.3)
   > 
   > case 1 泛化调用
   > 
   > ```
   > @Test
   >     public void testGenericService() {
   >         ReferenceConfig<GenericService> config = new ReferenceConfig<>();
   >         config.setInterface("org.apache.dubbo.samples.local.api.DemoService");
   >         config.setGeneric(Boolean.TRUE.toString());
   >         String result = (String)config.get().$invoke("sayHello", new String[]{"java.lang.String"}, new String[]{"world"});
   >     }
   > ```
   > 
   > case 2
   > 
   > ```
   > @Activate(group = {CommonConstants.PROVIDER, CommonConstants.CONSUMER})
   > public class DubboRequestFilter implements Filter {
   > 
   >     private final static Logger log = LoggerFactory.getLogger(DubboRequestFilter.class);
   > 
   >     @Override
   >     public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
   >         RpcContext.getServiceContext().isConsumerSide();
   >         Result invoke = invoker.invoke(invocation);
   >         //NPE
   >         RpcContext.getServiceContext().isConsumerSide();
   >         return invoke;
   >     }
   > }
   > ```
   > 
   > case 3
   > 
   > ```
   > java.lang.NullPointerException: null
   > 	at org.apache.dubbo.rpc.RpcServiceContext.isConsumerSide(RpcServiceContext.java:144)
   > 	at org.apache.dubbo.rpc.RpcContext.isConsumerSide(RpcContext.java:275)
   > 	at com....XxxDubboFilter.invoke(XxxDubboFilter.java:28)
   > 	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
   > 	at com.alibaba.csp.sentinel.adapter.dubbo.DubboAppContextFilter.invoke(DubboAppContextFilter.java:43)
   > 	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:327)
   > 	at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CallbackRegistrationInvoker.invoke(FilterChainBuilder.java:194)
   > 	at org.apache.dubbo.rpc.proxy.InvocationUtil.invoke(InvocationUtil.java:56)
   > 	at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:75)
   > 	at org.apache.dubbo.metadata.MetadataServiceDubboProxy0.getMetadataInfo(MetadataServiceDubboProxy0.java)
   > 	at org.apache.dubbo.registry.client.metadata.MetadataUtils.getRemoteMetadata(MetadataUtils.java:173)
   > ```
   
   调用结束后 RpcServiceContext 会进行清理,如果有处理需要的话请实现 Filter.Listener 的 onResponse 接口


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [dubbo] wuwen5 commented on issue #10959: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
wuwen5 commented on issue #10959:
URL: https://github.com/apache/dubbo/issues/10959#issuecomment-1358733497

   @AlbumenJ  这个问题任然存在
   
   case 1 泛化调用
   ```
   @Test
       public void testGenericService() {
           ReferenceConfig<GenericService> config = new ReferenceConfig<>();
           config.setInterface("org.apache.dubbo.samples.local.api.DemoService");
           config.setGeneric(Boolean.TRUE.toString());
           String result = (String)config.get().$invoke("sayHello", new String[]{"java.lang.String"}, new String[]{"world"});
       }
   ```
   
   case 2
   ```
   @Activate(group = {CommonConstants.PROVIDER, CommonConstants.CONSUMER})
   public class DubboRequestFilter implements Filter {
   
       private final static Logger log = LoggerFactory.getLogger(DubboRequestFilter.class);
   
       @Override
       public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
           RpcContext.getServiceContext().isConsumerSide();
           Result invoke = invoker.invoke(invocation);
           //NPE
           RpcContext.getServiceContext().isConsumerSide();
           return invoke;
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [dubbo] AlbumenJ commented on issue #10959: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10959:
URL: https://github.com/apache/dubbo/issues/10959#issuecomment-1321428113

   之前修复是在 3.0 分支做的,发版的时候没有合并到新分支。
   这个已经修复 https://github.com/apache/dubbo/commit/ae0a371690546ce859f2041814f76dad2c710fd9
   
   对应的集成测试用例已经完善,https://github.com/apache/dubbo-samples/pull/586。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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