This is an automated email from the ASF dual-hosted git repository.

crazyhzm pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new 8009c72030 Ignore class loading failure when native is compiled 
(#13009)
8009c72030 is described below

commit 8009c72030ecb7086bbf33e8e1d42410353c2e4d
Author: huazhongming <[email protected]>
AuthorDate: Tue Sep 5 11:31:54 2023 +0800

    Ignore class loading failure when native is compiled (#13009)
    
    Signed-off-by: crazyhzm <[email protected]>
---
 .../main/java/org/apache/dubbo/aot/generate/AotProcessor.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/dubbo-native/src/main/java/org/apache/dubbo/aot/generate/AotProcessor.java 
b/dubbo-native/src/main/java/org/apache/dubbo/aot/generate/AotProcessor.java
index a2c15e4bf7..dfb0257ef1 100644
--- a/dubbo-native/src/main/java/org/apache/dubbo/aot/generate/AotProcessor.java
+++ b/dubbo-native/src/main/java/org/apache/dubbo/aot/generate/AotProcessor.java
@@ -62,7 +62,16 @@ public class AotProcessor {
     private static List<TypeDescriber> getTypes() {
         List<TypeDescriber> typeDescribers = new ArrayList<>();
         
FrameworkModel.defaultModel().defaultApplication().getExtensionLoader(ReflectionTypeDescriberRegistrar.class).getSupportedExtensionInstances().forEach(reflectionTypeDescriberRegistrar
 -> {
-            
typeDescribers.addAll(reflectionTypeDescriberRegistrar.getTypeDescribers());
+            List<TypeDescriber> describers = new ArrayList<>();
+            try {
+                describers = 
reflectionTypeDescriberRegistrar.getTypeDescribers();
+            } catch (Throwable e) {
+                // The ReflectionTypeDescriberRegistrar implementation classes 
are shaded, causing some unused classes to be loaded.
+                // When loading a dependent class may appear that cannot be 
found, it does not affect.
+                // ignore
+            }
+
+            typeDescribers.addAll(describers);
         });
 
         return typeDescribers;

Reply via email to