I am trying to implement a very simple integration flow, but can't figure out why I get an error during the deployment. Any help is greatly appreciated.
Xml Config:
<gateway id="eventGateway"
service-interface="com.acme.EventGateway"/>
<publish-subscribe-channel id="eventChannel"/>
<service-activator
input-channel="eventChannel"
ref="eventService"
method="saveEvent"/>
Interface:
public interface EventGateway {
@Gateway(requestChannel = "eventChannel")
public void saveEvent(Event event);
}
Exception:
Error creating bean with name 'eventGateway': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.sun.proxy.$Proxy130]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class class com.sun.proxy.$Proxy130
EDIT:
I also have a Java Configuration class with @EnableAspectJAutoProxy
annotation.
When I remove @EnableAspectJAutoProxy
annotation the error goes away.
EDIT2:
I've tried annotating the interface with:
@Scope(proxyMode = ScopedProxyMode.INTERFACES)
but it didn't make any difference.