Announcement Announcement Module
Collapse
No announcement yet.
Failed dependency injection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failed dependency injection

    version: 1.1.3

    Hi, I have a case where 2 proxied beans (A and B) are injected to each other and I am getting the following error:

    Cannot create AopProxy with no Advisors and no target source
    If I comment out one side or the other of the dependency (by commenting out the setter method of one DAO class or the other), the proxies resolve fine (i.e. no error), here is my config snippet:

    Code:
      <bean id="aDAO" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="target">
          <bean class="dao.hibernate.ADAOImpl" autowire="byName" />
        </property>
        <property name="interceptorNames">
          <list>
            <value>stripAdvisor</value>
          </list>
        </property>
      </bean>
      <bean id="bDAO" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="target">
          <bean class="dao.hibernate.BDAOImpl" autowire="byName" />
        </property>
        <property name="interceptorNames">
          <list>
            <value>stripAdvisor</value>
          </list>
        </property>
      </bean>
    In "A" I define the method setBDAO(...) and in B I define the method setADAO(...).

    Any ideas for why this would happen and what I can do to avoid this issue (perhaps by avoiding CGLIB proxying) Do I need to autowire the proxy rather then the proxied bean? All my other relationships work fine (and are wired precisely the same way). :?

    Cheers
    Steve
Working...
X