Details
-
Type:
Task
-
Status: Closed
-
Priority:
Minor
-
Resolution: Complete
-
Affects Version/s: 4.0.2
-
Component/s: Core
-
Labels:
-
Environment:Spring core 4.0.4
-
Pull Request URL:
Description
Interface methods are eligible for annotation with Spring's @Async. When a GatewayProxyFactoryBean is used to provide an implementation for such an interface and the @EnableAsync advice is applied in proxy mode, invocations of the service method throw a NullPointerException. The exception is not thrown if @EnableAsync is not applied, and hand-writing a wrapper implementation that autowires the message channel and sends a GenericMessage with the argument as the payload works correctly.
In this stack trace, handlePostback(PostbackObject postback) is declared on the PostbackHandler interface, and I used <int:gateway> to wire the method onto a message chain.
java.lang.IllegalArgumentException: Class must not be null at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:279) at org.springframework.core.annotation.AnnotationUtils.findAnnotation(AnnotationUtils.java:266) at org.springframework.aop.support.annotation.AnnotationClassFilter.matches(AnnotationClassFilter.java:65) at org.springframework.aop.support.ClassFilters$UnionClassFilter.matches(ClassFilters.java:101) at org.springframework.aop.framework.DefaultAdvisorChainFactory.getInterceptorsAndDynamicInterceptionAdvice(DefaultAdvisorChainFactory.java:62) at org.springframework.aop.framework.AdvisedSupport.getInterceptorsAndDynamicInterceptionAdvice(AdvisedSupport.java:489) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:193) at com.sun.proxy.$Proxy101.handlePostback(Unknown Source)
Attachments
Issue Links
- depends on
-
SPR-11910 @Async isn't applied, if the interface doesn't have concrete implementation
-
- Closed
-