Results 1 to 6 of 6

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

  1. #1
    Join Date
    Sep 2004
    Location
    Texas
    Posts
    155

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

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Have you tried 2.0-RC2 also?
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Sep 2004
    Location
    Texas
    Posts
    155

    Default

    Quote Originally Posted by Costin Leau
    Have you tried 2.0-RC2 also?
    Yes, this problem occurred in 2.0 RC2.
    Corby

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Sep 2004
    Location
    Texas
    Posts
    155

  6. #6
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •