I have a set of Spring config files that work just fine, until I add:
<aop:aspectj-autoproxy/>
Note, this is without adding any pointcut or advisor definitions, I just added the autoproxy declaration.
It appears to object to the existence of an abstract bean that is defined in my config:
Code:<bean id="baseSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" abstract="true"> <property name="mappingResources"> <list> <value>bigdeal.hbm.xml</value> <value>osworkflow.hbm.xml</value> </list> </property> <property name="dataSource" ref="dataSource"/> <property name="entityInterceptor" ref="dependencyInjectionInterceptor"/> </bean> <bean id="bigdealSessionFactory" parent="baseSessionFactory"> <property name="hibernateProperties"> <props> [Boring config excluded] </props> </property> </bean>
The stacktrace I get on startup is:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'bigdealSessionFactory' defined in class path resource [serverComponents.xml]:
Cannot resolve reference to bean 'dataSource' while setting bean property'dataSource';
nested exception is org.springframework.beans.factory.BeanIsAbstractEx ception:
Error creating bean with name 'baseSessionFactory':
Bean definition is abstract
Caused by: org.springframework.beans.factory.BeanIsAbstractEx ception:
Error creating bean with name 'baseSessionFactory':
Bean definition is abstract
at org.springframework.beans.factory.support.Abstract BeanFactory.checkMergedBeanDefinition(AbstractBean Factory.java:804)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:153)
at org.springframework.beans.factory.support.Abstract BeanFactory.getType(AbstractBeanFactory.java:377)
at org.springframework.aop.aspectj.annotation.Annotat ionAwareAspectJAutoProxyCreator.createAspectJAdvis ors(AnnotationAwareAspectJAutoProxyCreator.java:16 7)
at org.springframework.aop.aspectj.annotation.Annotat ionAwareAspectJAutoProxyCreator.findCandidateAdvis ors(AnnotationAwareAspectJAutoProxyCreator.java:13 7)
at org.springframework.aop.framework.autoproxy.Abstra ctAdvisorAutoProxyCreator.findEligibleAdvisors(Abs tractAdvisorAutoProxyCreator.java:67)
at org.springframework.aop.framework.autoproxy.Abstra ctAdvisorAutoProxyCreator.getAdvicesAndAdvisorsFor Bean(AbstractAdvisorAutoProxyCreator.java:53)
I noticed that there is a previous (resolved) issue on the interaction between <aop:aspectj-autoproxy/> and Abstract Beans:
http://opensource.atlassian.com/proj...rowse/SPR-2143
Could this be related?


Reply With Quote