You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
agentLanguage agent related.bugSomething isn't working and you are sure it's a bug!pluginPlugin for agent or collector. Be used to extend the capabilities of default implementor.
Please answer these questions before submitting your issue.
Why do you submit this issue?
Question or discussion
Bug
Requirement
Feature or performance improvement
Question
What do you want to know?
extension.SpringExtensionFactory - [DUBBO] No spring extension(bean) named:skyWalkingDynamicField, try to find an extension(bean) of type java.lang.Object, dubbo version: oss, current host: 192.168.0.3
ERROR extension.ExtensionLoader - [DUBBO] fail to inject via method setSkyWalkingDynamicField of interface com.alibaba.dubbo.rpc.Filter:
Bug
Which version of SkyWalking, OS and JRE?
SkyWalking5.6.0、dubbo2.6.2、jre1.8
Which company or project?
What happen?
If possible, provide a way for reproducing the error. e.g. demo application, component version.
dubbo2.6.0- is ok、but dubbo2.6.2+ didn't support
@wu-sheng Hey, I also met this problem and I found the reason. Because Skywalking will add setSkyWalkingDynamicField(Object) to class MonitorFilter and this conflicts with dubbo's spi extention mechanism.
/* * com.alibaba.dubbo.common.extension.ExtensionLoader * Here dubbo's spi extention mechanism will traverse all the public set method */privateTinjectExtension(Tinstance) {
try {
if (objectFactory != null) {
for (Methodmethod : instance.getClass().getMethods()) {
if (method.getName().startsWith("set")
&& method.getParameterTypes().length == 1
&& Modifier.isPublic(method.getModifiers())) {
Class<?> pt = method.getParameterTypes()[0];
try {
Stringproperty = method.getName().length() > 3 ? method.getName().substring(3, 4).toLowerCase() + method.getName().substring(4) : "";
Objectobject = objectFactory.getExtension(pt, property);
if (object != null) {
method.invoke(instance, object);
}
} catch (Exceptione) {
logger.error("fail to inject via method " + method.getName()
+ " of interface " + type.getName() + ": " + e.getMessage(), e);
}
}
}
}
} catch (Exceptione) {
logger.error(e.getMessage(), e);
}
returninstance;
}
Before dubbo 2.6.3, the extentionFactory just get bean by name, so there is no errro.
/* * com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory */@Override@SuppressWarnings("unchecked")
public <T> TgetExtension(Class<T> type, Stringname) {
for (ApplicationContextcontext : contexts) {
if (context.containsBean(name)) {
Objectbean = context.getBean(name);
if (type.isInstance(bean)) {
return (T) bean;
}
}
}
returnnull;
}
After, dubbo monify the code, it also get bean by type and this throw the exception.
@Override@SuppressWarnings("unchecked")
public <T> TgetExtension(Class<T> type, Stringname) {
for (ApplicationContextcontext : contexts) {
if (context.containsBean(name)) {
Objectbean = context.getBean(name);
if (type.isInstance(bean)) {
return (T) bean;
}
}
}
logger.warn("No spring extension(bean) named:" + name + ", try to find an extension(bean) of type " + type.getName());
for (ApplicationContextcontext : contexts) {
try {
returncontext.getBean(type);
} catch (NoUniqueBeanDefinitionExceptionmultiBeanExe) {
//here will throw exception because setSkyWalkingDynamicField() type is Object and spring will find many beansthrowmultiBeanExe;
} catch (NoSuchBeanDefinitionExceptionnoBeanExe) {
if (logger.isDebugEnabled()) {
logger.debug("Error when get spring extension(bean) for type:" + type.getName(), noBeanExe);
}
}
}
logger.warn("No spring extension(bean) named:" + name + ", type:" + type.getName() + " found, stop get bean.");
returnnull;
}
I guess the newly added method setSkyWalkingDynamicField(Object) from SkyWalking is not expected to be automatically injected by Dubbo framework. To make Dubbo more adaptable, I think we should do the following:
A method level annotation to enable auto-injection or not.
Special handling for generic Object parameter type.
A method level annotation to enable auto-injection or not.
@chickenlj I hope the default is not :) SkyWalking will add this method to all enhanced classes, we can't add an annotation belongs to Dubbo only, may trigger ClassNotFound in other scenarios.
Or, when could not find the inject way, just ignore. The auto set should not be active always from my perspective.
A method level annotation to enable auto-injection or not.
@chickenlj I hope the default is not :) SkyWalking will add this method to all enhanced classes, we can't add an annotation belongs to Dubbo only, may trigger ClassNotFound in other scenarios.
Set the default value to not would bring lots of changes to Dubbo, many methods would need to add an annotation and enable injection. Can't SkyWalking just add an annotation when instrumenting Dubbo?
Anyway, I think Dubbo need an annotation to flexibly control the injection action.
Or, when could not find the inject way, just ignore. The auto set should not be active always from my perspective.
Sounds reasonable, I will consider the possibility of ignoring it when fails.
@chickenlj@wu-sheng Sad……Because dubbo 2.6.6 has bugs so I degrade to dubbo 2.6.4……But I meet this problem. I meet the problem as same as 2009 which QQ or 360 I must choose at most one……
Apache can't randomly release, and each release is unchangeable. So... I am afraid Dubbo community did the right thing. Only the next release is an option. We could ask a Dubbo committer do patch release, such as 2.6.7-patch1, if the community accepts that.
You could try :) I am just concerned that, it will break the SpringMVC plugin.
Or maybe I can delete the dubbo plugin?[It may works]
Also I consider about delete the dubbo Monitorfilter [Skywalking just enchace this class]--->The same result with delete dubbo plugin
agentLanguage agent related.bugSomething isn't working and you are sure it's a bug!pluginPlugin for agent or collector. Be used to extend the capabilities of default implementor.
Activity
wu-sheng commentedon Oct 16, 2018
@ascrutae please take a look at this.
[-]It does not dubbo v2.6.2+?[/-][+]It does not support dubbo v2.6.2+?[/+]KerwinAusten commentedon Oct 23, 2018
@wu-sheng Hey, I also met this problem and I found the reason. Because Skywalking will add
setSkyWalkingDynamicField(Object)to class MonitorFilter and this conflicts with dubbo's spi extention mechanism.Before dubbo 2.6.3, the extentionFactory just get bean by name, so there is no errro.
After, dubbo monify the code, it also get bean by type and this throw the exception.
Emmm....Maybe you can communicate with dubbo....
wu-sheng commentedon Oct 23, 2018
@IcebergXTY Thanks for the feedback. I already dropped an request in Dubbo mail list, https://lists.apache.org/thread.html/ed79a0284fddfedc53c96e5666a059617693cd4d7628c32de2935ea4@%3Cdev.dubbo.apache.org%3E . Let's wait and see what are they going to response, and we could work from here.
diecui1202 commentedon Oct 23, 2018
@chickenlj I've checked the git commit log, this change is from you. Could u pls. take some time to look at it?
chickenlj commentedon Oct 23, 2018
Sure, I am here on it.
I guess the newly added method
setSkyWalkingDynamicField(Object)from SkyWalking is not expected to be automatically injected by Dubbo framework. To make Dubbo more adaptable, I think we should do the following:chickenlj commentedon Oct 23, 2018
@IcebergXTY @wu-sheng Do you think this will solve your problem?
wu-sheng commentedon Oct 23, 2018
@chickenlj I hope the default is not :) SkyWalking will add this method to all enhanced classes, we can't add an annotation belongs to Dubbo only, may trigger ClassNotFound in other scenarios.
Or, when could not find the inject way, just ignore. The auto set should not be active always from my perspective.
chickenlj commentedon Oct 23, 2018
Set the default value to not would bring lots of changes to Dubbo, many methods would need to add an annotation and enable injection. Can't SkyWalking just add an annotation when instrumenting Dubbo?
Anyway, I think Dubbo need an annotation to flexibly control the injection action.
Sounds reasonable, I will consider the possibility of ignoring it when fails.
15 remaining items
wu-sheng commentedon Nov 23, 2018
Great. Closing this. Supported is back in 2.6.5 release.
qixiaobo commentedon Jul 29, 2019
@chickenlj @wu-sheng Sad……Because dubbo 2.6.6 has bugs so I degrade to dubbo 2.6.4……But I meet this problem. I meet the problem as same as 2009 which QQ or 360 I must choose at most one……
apache/dubbo#4612
wu-sheng commentedon Jul 29, 2019
They are talking about 2.6.7 is available, is that a better choice? This is also a Dubbo bug... sadly.
qixiaobo commentedon Jul 29, 2019
Sad……


2.6.X merges my pr…… But 2.6.7 never ……
Maybe 2.6.8…… I cannot wait for it
wu-sheng commentedon Jul 29, 2019
Apache can't randomly release, and each release is unchangeable. So... I am afraid Dubbo community did the right thing. Only the next release is an option. We could ask a Dubbo committer do patch release, such as 2.6.7-patch1, if the community accepts that.
qixiaobo commentedon Jul 29, 2019
You are right, so spring-cloud-alibaba comes back to alibaba repo. Thanks for replying
qixiaobo commentedon Jul 30, 2019
How about I add a spring bean named skyWalkingDynamicField to avoid this problem ? @wu-sheng In this mechanism maybe skywalking never need this field?
wu-sheng commentedon Jul 30, 2019
SkyWalking plugin requires this field. I doubt this w/ highly possible risks.
qixiaobo commentedon Jul 30, 2019
I have no other choices since dubbo 2.6.5+ has a bug cannot serialize and 2.6.8 is not release yet…… Maybe I can try?
wu-sheng commentedon Jul 30, 2019
You could try :) I am just concerned that, it will break the SpringMVC plugin.
qixiaobo commentedon Jul 30, 2019
Or maybe I can delete the dubbo plugin?[It may works]
Also I consider about delete the dubbo Monitorfilter [Skywalking just enchace this class]--->The same result with delete dubbo plugin
qixiaobo commentedon Jul 30, 2019
I add this code to my spring config , and it works~
wu-sheng commentedon Jul 30, 2019
That is luck :) Hope it would break other things.