2

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.

anazimok
  • 1,750
  • 2
  • 20
  • 33
  • Strange - I can't reproduce it with a simple example; can you share more about the class that is annotated with `@EnableAspectJAutoProxy`? How is it pulled into the context etc. You have lots of proxies (at least 130), but that annotation should only affect classes annotated with `@Aspect`. My guess is some other BPP is proxying the gateway. First step would be to get DEBUG logs for org.springframework (assuming it's a framework BPP that's proxying). If that doesn't help, try whittling it down to a simple test case, and use a debugger to figure it out. I can help if you have a small test case. – Gary Russell May 14 '15 at 08:05
  • I enabled the DEBUG level for the org.springframework but didn't find any additional info. – anazimok May 14 '15 at 16:27

0 Answers0