【发布时间】:2011-11-15 04:53:30
【问题描述】:
我正在使用 spring AOP 的环绕建议来捕获事务的处理时间。我在应用程序启动期间收到以下错误
error creating bean "coreMessageResourceAccesor"
Could not generate CGLIB subclass of class
[class org.springframework.context.support.MessageSourceAccessor]:
Common causes of this problem include using a final class or a non-visible class;
nested exception is java.lang.IllegalArgumentException:
Superclass has no null constructors but no arguments were given
在thread 的帮助下,我确定了问题所在。但是我不能将 coreMessageResourceAccesor bean 更改为使用基于 setter 的注入,因为它使用 spring 类并且该类没有 arg 构造函数
下面是bean的配置
<bean id="coreMessageSourceAccessor"
class="org.springframework.context.support.MessageSourceAccessor" >
<constructor-arg type="org.springframework.context.MessageSource"
ref="coreMessageSource" />
</bean>
如果有人可以提供帮助,我将不胜感激。感谢您的宝贵时间。
【问题讨论】:
标签: spring aop spring-aop cglib