Announcement Announcement Module
Collapse
No announcement yet.
<aop:aspectj-autoproxy/> and Abstract Beans Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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:

    <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?

  • #2
    Have you tried 2.0-RC2 also?

    Comment


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

      Comment


      • #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.

        Comment


        • #5
          Done, thanks.

          http://opensource.atlassian.com/proj...rowse/SPR-2265

          Comment


          • #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).

            Comment

            Working...
            X