Announcement Announcement Module
No announcement yet.
aop:config - BeanCurrentlyInCreationException Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • aop:config - BeanCurrentlyInCreationException

    I have business logic ClasssA and ClassB, they are circular reference, but I'm not to use constructor injection and stick to setter injection only.

    If I add the <aop:config> segment like below, thire's a BeanCurrentlyInCreationException like this:

    org.springframework.beans.factory.BeanCurrentlyInC reationException: Error creating bean with name 'channelBO': Bean with name 'channelBO' has been injected into other beans [MetaPageBO] in its raw version as part of a circular reference, but has eventually been wrapped (for example as part of auto-proxy creation). This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
    But If remove the <aop:config> segment, it works.

    Why? Could any one give me a hand?

    ClassA {
       ClassB classB;
    ClassB {
       ClassA classA;
    The application context:
    <aop:config proxy-target-class="true">
            <aop:pointcut id="txPointcut" expression="execution(*  Class*(..))"/>
            <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"/>
    <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
            <property name="dataSource" ref="dataSource"/>
        <tx:advice id="txAdvice" transaction-manager="txManager">
                <tx:method name="add*" rollback-for="Exception"/>
                <tx:method name="insert*" rollback-for="Exception"/>
                <tx:method name="create*" rollback-for="Exception"/>
                <tx:method name="update*" rollback-for="Exception"/>
                <tx:method name="edit*" rollback-for="Exception"/>
                <tx:method name="*" read-only="true"/>
    <bean id="classA" class="ClassA">
      <property name="classB" ref="classB"/>
    <bean id="classB" class="ClassB">
      <property name="classA" ref="classA"/>
    I need someone to help me. I think it is possible to solve them using BeanPostProcessor, but not how to do it.

    Thank you

  • #2
    Having the same problem. Any idea what can be done?


    • #3
      Submitted JIRA issue

      I have submitted an issue in JIRA, so I guess we'll just have to wait and see what the gurus in charge have to say about it

      See the issue at:

      I have also added a comment about a possible work around that one can use, while waiting for (hopefully) a solution.