我使用spring AOP的around建議來捕獲事務的處理時間。在應用程序啓動時,我發現了以下錯誤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豆,因爲它使用彈簧類來使用基於setter注入&那類不無參數的構造函數
下面是配置爲bean
<bean id="coreMessageSourceAccessor"
class="org.springframework.context.support.MessageSourceAccessor" >
<constructor-arg type="org.springframework.context.MessageSource"
ref="coreMessageSource" />
</bean>
我真的很感激,如果有人可以幫忙。謝謝你的時間。
謝謝skaffman。這是一個現有的應用程序,並且MessageSourceAccessor bean正在被注入到一堆不同的類中,我不太願意更改所有其他類。我想知道是否有任何其他解決此問題的方法。請指教 – swetha