From 4d2a4cad766ac9fd5f86fc902fcd90ca55520c89 Mon Sep 17 00:00:00 2001 From: abilan Date: Tue, 15 Nov 2022 13:33:53 -0500 Subject: [PATCH] Fix GatewayProxyInstPProc for AOT expectations Turns out the AOT engine deals only with indexed constructor arguments for bean definition * Rework `GatewayProxyInstantiationPostProcessor.processAheadOfTime()` to populate a service interface type as an indexed ctor argument instead of generic one --- .../config/GatewayProxyInstantiationPostProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/GatewayProxyInstantiationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/GatewayProxyInstantiationPostProcessor.java index 9813df8f06..d5e15aa9f7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/GatewayProxyInstantiationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/GatewayProxyInstantiationPostProcessor.java @@ -88,7 +88,7 @@ class GatewayProxyInstantiationPostProcessor implements if (beanClass.isInterface() && AnnotatedElementUtils.hasAnnotation(beanClass, MessagingGateway.class)) { RootBeanDefinition beanDefinition = registeredBean.getMergedBeanDefinition(); beanDefinition.setBeanClass(AnnotationGatewayProxyFactoryBean.class); - beanDefinition.getConstructorArgumentValues().addGenericArgumentValue(beanClass); + beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0, beanClass); beanDefinition.setTargetType( ResolvableType.forClassWithGenerics(AnnotationGatewayProxyFactoryBean.class, beanClass)); }