You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/09/24 05:05:53 UTC
[dubbo] branch 3.0 updated: Try Load Class from interface parameter
(#8905)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 6273320 Try Load Class from interface parameter (#8905)
6273320 is described below
commit 62733201e9241c7429e61f4e9210e21109fd2ca7
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Fri Sep 24 13:05:42 2021 +0800
Try Load Class from interface parameter (#8905)
---
.../java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java
index bd18402..afb1c11 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/AbstractProxyFactory.java
@@ -38,7 +38,7 @@ import static org.apache.dubbo.rpc.Constants.INTERFACES;
*/
public abstract class AbstractProxyFactory implements ProxyFactory {
private static final Class<?>[] INTERNAL_INTERFACES = new Class<?>[]{
- EchoService.class, Destroyable.class
+ EchoService.class, Destroyable.class
};
@Override
@@ -55,8 +55,13 @@ public abstract class AbstractProxyFactory implements ProxyFactory {
if (config != null && config.length() > 0) {
String[] types = COMMA_SPLIT_PATTERN.split(config);
for (String type : types) {
- ClassLoader classLoader = getClassLoader(invoker);
- interfaces.add(ReflectUtils.forName(classLoader, type));
+ try {
+ ClassLoader classLoader = getClassLoader(invoker);
+ interfaces.add(ReflectUtils.forName(classLoader, type));
+ } catch (Throwable e) {
+ // ignore
+ }
+
}
}