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 3ba20fba6c Fix native image for proxy (#14724)
3ba20fba6c is described below
commit 3ba20fba6cc7fde4dc7a89878c0aa0736e877a2e
Author: Jermaine Hua <[email protected]>
AuthorDate: Wed Sep 25 22:39:12 2024 +0800
Fix native image for proxy (#14724)
Signed-off-by: “JermaineHua” <[email protected]>
---
.../ReferenceAnnotationWithAotBeanPostProcessor.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/dubbo-config/dubbo-config-spring6/src/main/java/org/apache/dubbo/config/spring6/beans/factory/annotation/ReferenceAnnotationWithAotBeanPostProcessor.java
b/dubbo-config/dubbo-config-spring6/src/main/java/org/apache/dubbo/config/spring6/beans/factory/annotation/ReferenceAnnotationWithAotBeanPostProcessor.java
index 971e010e41..0a165b0e15 100644
---
a/dubbo-config/dubbo-config-spring6/src/main/java/org/apache/dubbo/config/spring6/beans/factory/annotation/ReferenceAnnotationWithAotBeanPostProcessor.java
+++
b/dubbo-config/dubbo-config-spring6/src/main/java/org/apache/dubbo/config/spring6/beans/factory/annotation/ReferenceAnnotationWithAotBeanPostProcessor.java
@@ -261,7 +261,17 @@ public class ReferenceAnnotationWithAotBeanPostProcessor
extends ReferenceAnnota
Class<?> c = referenceElement.getInjectedType();
AotUtils.registerSerializationForService(c, hints);
hints.reflection().registerType(TypeReference.of(c),
MemberCategory.INVOKE_PUBLIC_METHODS);
+ // need to enumerate all interfaces by the proxy
+ hints.proxies().registerJdkProxy(c, EchoService.class,
Destroyable.class);
hints.proxies().registerJdkProxy(c, EchoService.class,
Destroyable.class, GenericService.class);
+ hints.proxies()
+ .registerJdkProxy(
+ c,
+ EchoService.class,
+ Destroyable.class,
+ SpringProxy.class,
+ Advised.class,
+ DecoratingProxy.class);
hints.proxies()
.registerJdkProxy(
c,