Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentinel Dubbo adapter is not compatible with Dubbo 2.7.x #496

Closed
linzhiqiang0514 opened this issue Feb 19, 2019 · 4 comments · Fixed by #619
Closed

Sentinel Dubbo adapter is not compatible with Dubbo 2.7.x #496

linzhiqiang0514 opened this issue Feb 19, 2019 · 4 comments · Fixed by #619
Labels
area/integrations Issues or PRs related to integrations with open-source components kind/bug Category issues or prs related to bug.

Comments

@linzhiqiang0514
Copy link

Issue Description

Type: bug report

Describe what happened (or what feature you want)

aused by: org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service com.ffcs.crmd.test.facade.UserFacade. Tried 3 times of the providers [192.168.250.37:20880] (1/1) from the registry localhost:2181 on the consumer 192.168.250.37 using the dubbo version 2.7.0. Last error is: com.alibaba.dubbo.rpc.Invoker.getUrl()Lcom/alibaba/dubbo/common/URL;
at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:111) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:241) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:57) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java) ~[dubbo-2.7.0.jar:2.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_72]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_72]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_72]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_72]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:158) ~[dubbo-2.7.0.jar:2.7.0]
... 68 more
Caused by: java.lang.NoSuchMethodError: com.alibaba.dubbo.rpc.Invoker.getUrl()Lcom/alibaba/dubbo/common/URL;
at com.alibaba.csp.sentinel.adapter.dubbo.DubboAppContextFilter.invoke(DubboAppContextFilter.java:37) ~[sentinel-dubbo-adapter-1.4.1.jar:?]
at com.alibaba.dubbo.rpc.Filter.invoke(Filter.java:29) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:49) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:54) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:80) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:241) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:57) ~[dubbo-2.7.0.jar:2.7.0]
at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java) ~[dubbo-2.7.0.jar:2.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_72]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_72]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_72]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_72]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:158) ~[dubbo-2.7.0.jar:2.7.0]
... 68 more

Describe what you expected to happen

正常拦截,并推送信息到控制台。

How to reproduce it (as minimally and precisely as possible)

  1. dubbo2.7.0
  2. 集成Sentinel
  3. 调用服务

Tell us your environment

JDK1.8 + dubbo2.7.0

Anything else we need to know?

2.7的类名变化,Sentinel-dubbo-adapter未及时更新,导致报错。

@sczyh30 sczyh30 added the kind/bug Category issues or prs related to bug. label Feb 20, 2019
@sczyh30 sczyh30 changed the title Dubbo2.7.0 Sentinel Filter报错。 Sentinel Dubbo adapter is not compatible with Dubbo 2.7.x Feb 20, 2019
@sczyh30
Copy link
Member

sczyh30 commented Feb 20, 2019

Hi, thanks for reporting. Since Dubbo 2.7.0, the package com.alibaba.dubbo has been transferred to org.apache.dubbo, thus causing the exception. We have to keep compatible with both Dubbo 2.7.x and previous version, so maybe we need an additional module or mechanisms to support the new version of Dubbo.

@sczyh30 sczyh30 added the area/integrations Issues or PRs related to integrations with open-source components label Feb 20, 2019
@oawang
Copy link

oawang commented Feb 25, 2019

mark, when to support ?

@cdfive
Copy link
Collaborator

cdfive commented Feb 26, 2019

Compile with Dubbo 2.5.8 and JDK1.6 in sentinel-dubbo-adaptor cause the NoSuchMethodError.
I tried with Dubbo 2.5.8 and JDK1.8, the same Error are thrown.

Dubbo 2.7.0 using dubbo-compatible module to support repackage from com.alibaba.dubbo to org.apache.dubbo, which using default interface method of JDK1.8 and proxy pattern, no code need to changed.
@see
http://dubbo.apache.org/zh-cn/blog/dubbo-compatible.html

To support Dubbo 2.7.x, Sentinel Filter code needn't modify, but only upgrade the dependency Dubbo version to 2.7.x and JDK version to 1.8.

But if modify in one module , it can't support for Dubbo 2.6.x with JDK1.8, or Dubbo 2.6.x with JDK1.6.

Maybe dubbo-compatible can be modify to support this,
or we can seek a way to package two sentinel-dubbo-adapter.jar in one maven module, one jar is with Dubbo2.6.x and JDK1.6, another is with Dubbo2.7.x and JDK1.8.

@sczyh30
Copy link
Member

sczyh30 commented Mar 27, 2019

We'll add a module sentinel-apache-dubbo-adapter that is only compatible with Apache Dubbo 2.7.x and above. See #619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integrations Issues or PRs related to integrations with open-source components kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants