Announcement Announcement Module
No announcement yet.
<aop:aspectj-autoproxy/> and Abstract Beans Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • <aop:aspectj-autoproxy/> and Abstract Beans

    I have a set of Spring config files that work just fine, until I add:


    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:

       <bean id="baseSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" abstract="true">
          <property name="mappingResources">
          <property name="dataSource" ref="dataSource"/>
          <property name="entityInterceptor" ref="dependencyInjectionInterceptor"/>
       <bean id="bigdealSessionFactory" parent="baseSessionFactory">
          <property name="hibernateProperties">
                [Boring config excluded]

    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 BeanFactory.checkMergedBeanDefinition(AbstractBean
    at BeanFactory.getBean(
    at BeanFactory.getBean(
    at BeanFactory.getType(
    at org.springframework.aop.aspectj.annotation.Annotat ionAwareAspectJAutoProxyCreator.createAspectJAdvis ors( 7)
    at org.springframework.aop.aspectj.annotation.Annotat ionAwareAspectJAutoProxyCreator.findCandidateAdvis ors( 7)
    at org.springframework.aop.framework.autoproxy.Abstra ctAdvisorAutoProxyCreator.findEligibleAdvisors(Abs
    at org.springframework.aop.framework.autoproxy.Abstra ctAdvisorAutoProxyCreator.getAdvicesAndAdvisorsFor Bean(

    I noticed that there is a previous (resolved) issue on the interaction between <aop:aspectj-autoproxy/> and Abstract Beans:

    Could this be related?

  • #2
    Have you tried 2.0-RC2 also?


    • #3
      Originally posted by Costin Leau
      Have you tried 2.0-RC2 also?
      Yes, this problem occurred in 2.0 RC2.


      • #4
        I'm not sure if the issues are related - please raise an issue to keep track of it as it seems to be a bug. Thanks.


        • #5
          Done, thanks.


          • #6
            As a side note - I've noticed you are using OSworkflow - you might want to check the OsWorkflow support from Spring Modules (the upcoming release 0.5 will be released by the end of this week and it includes docs regarding the oswf integration).