Spring Integration:部署期间的CGLIB错误

时间:2015-05-13 21:22:05

标签: spring aop spring-integration spring-aop cglib

我正在尝试实现一个非常简单的集成流程,但无法弄清楚为什么在部署期间出现错误。非常感谢任何帮助。

Xml配置:

<gateway id="eventGateway"
         service-interface="com.acme.EventGateway"/>

<publish-subscribe-channel id="eventChannel"/>

<service-activator
        input-channel="eventChannel"
        ref="eventService"
        method="saveEvent"/>

接口

public interface EventGateway {
@Gateway(requestChannel = "eventChannel")
    public void saveEvent(Event event);
}

例外:

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

修改 我还有一个带有@EnableAspectJAutoProxy注释的Java Configuration类。 当我删除@EnableAspectJAutoProxy注释时,错误就会消失。

EDIT2: 我试过用以下方法注释界面: @Scope(proxyMode = ScopedProxyMode.INTERFACES)但它没有任何区别。

0 个答案:

没有答案