Announcement Announcement Module
Collapse
No announcement yet.
Cannot create AopProxy with no advisors and no target source Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot create AopProxy with no advisors and no target source

    hi,

    *sorry for the long post, but I don't know better than to paste all I got*

    I'm running an AndroMDA generated application and I'm getting this exception for some of the entities (not all of them), I cannot pinpoint what's causing it, and I don't know why some of them fail with this exception and the others don't.

    I am using JBoss 3.2.5 with Spring 1.1.2 on Windows XP, I'm using Hibernate 2.1.6 as ORM

    anyone has an idea about this ?

    thanks in advance
    -- Wouter


    ps: (I have pasted my applicationContext.xml below too)

    org.springframework.aop.framework.AopConfigExcepti on: Cannot create AopProxy with no advisors and no target source
    org.springframework.aop.framework.Cglib2AopProxy.< init>(Cglib2AopProxy.java:97)
    org.springframework.aop.framework.DefaultAopProxyF actory$CglibProxyFactory.createCglibProxy(DefaultA opProxyFactory.java:62)
    org.springframework.aop.framework.DefaultAopProxyF actory$CglibProxyFactory.access$000(DefaultAopProx yFactory.java:59)
    org.springframework.aop.framework.DefaultAopProxyF actory.createAopProxy(DefaultAopProxyFactory.java: 47)
    org.springframework.aop.framework.AdvisedSupport.c reateAopProxy(AdvisedSupport.java:567)
    org.springframework.aop.framework.ProxyFactoryBean .getSingletonInstance(ProxyFactoryBean.java:233)
    org.springframework.aop.framework.ProxyFactoryBean .getObject(ProxyFactoryBean.java:213)
    org.springframework.beans.factory.support.Abstract BeanFactory.getObjectForSharedInstance(AbstractBea nFactory.java:790)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:204)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:163)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveReference(Abstra ctAutowireCapableBeanFactory.java:898)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveValueIfNecessary (AbstractAutowireCapableBeanFactory.java:832)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:773)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:601)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:258)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:193)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:240)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:163)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveReference(Abstra ctAutowireCapableBeanFactory.java:898)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveValueIfNecessary (AbstractAutowireCapableBeanFactory.java:832)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:773)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:601)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:258)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:193)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:240)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:163)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveReference(Abstra ctAutowireCapableBeanFactory.java:898)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveValueIfNecessary (AbstractAutowireCapableBeanFactory.java:832)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:773)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:601)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:258)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:193)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:240)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:163)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveReference(Abstra ctAutowireCapableBeanFactory.java:898)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveValueIfNecessary (AbstractAutowireCapableBeanFactory.java:832)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:773)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:601)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:258)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:193)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:240)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:163)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:230)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:304)
    org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:80)
    org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:65)
    sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
    org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:73)
    org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:71)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:462)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:238)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:193)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:240)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:163)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:236)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:304)
    org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:80)
    org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:65)
    org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:56)
    org.springframework.context.access.ContextSingleto nBeanFactoryLocator.createDefinition(ContextSingle tonBeanFactoryLocator.java:127)
    org.springframework.beans.factory.access.Singleton BeanFactoryLocator.useBeanFactory(SingletonBeanFac toryLocator.java:373)
    org.springframework.ejb.support.AbstractEnterprise Bean.loadBeanFactory(AbstractEnterpriseBean.java:1 15)
    org.springframework.ejb.support.AbstractStatelessS essionBean.ejbCreate(AbstractStatelessSessionBean. java:63)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.jboss.ejb.StatelessSessionEnterpriseContext.<i nit>(StatelessSessionEnterpriseContext.java:52)
    org.jboss.ejb.plugins.StatelessSessionInstancePool .create(StatelessSessionInstancePool.java:35)
    org.jboss.ejb.plugins.AbstractInstancePool.get(Abs tractInstancePool.java:168)
    org.jboss.ejb.plugins.StatelessSessionInstanceInte rceptor.invoke(StatelessSessionInstanceInterceptor .java:58)
    org.jboss.ejb.plugins.AbstractTxInterceptor.invoke Next(AbstractTxInterceptor.java:84)
    org.jboss.ejb.plugins.TxInterceptorCMT.runWithTran sactions(TxInterceptorCMT.java:315)
    org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxIn terceptorCMT.java:148)
    org.jboss.ejb.plugins.SecurityInterceptor.invoke(S ecurityInterceptor.java:120)
    org.jboss.ejb.plugins.LogInterceptor.invoke(LogInt erceptor.java:191)
    org.jboss.ejb.plugins.ProxyFactoryFinderIntercepto r.invoke(ProxyFactoryFinderInterceptor.java:122)
    org.jboss.ejb.StatelessSessionContainer.internalIn voke(StatelessSessionContainer.java:331)
    org.jboss.ejb.Container.invoke(Container.java:723)
    org.jboss.ejb.plugins.local.BaseLocalProxyFactory. invoke(BaseLocalProxyFactory.java:359)
    org.jboss.ejb.plugins.local.StatelessSessionProxy. invoke(StatelessSessionProxy.java:83)
    $Proxy86.listTypes(Unknown Source)
    be.vw.wc.article.search.ArticleSearchControllerImp l.preload(ArticleSearchControllerImpl.java:25)
    be.vw.wc.article.search.ArticleSearch._preload(Art icleSearch.java:38)
    be.vw.wc.article.search.ArticleSearch.execute(Arti cleSearch.java:18)
    org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:421)
    org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:226)
    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1164)
    org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:397)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:697)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:810)
    org.displaytag.filter.ResponseOverrideFilter.doFil ter(ResponseOverrideFilter.java:86)


    and this is the applicationContext.xml I am using


    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
    
    <beans>
    
        <!-- ========================= GENERAL DEFINITIONS ========================= -->
    
        <!-- Message source for this context, loaded from localized "messages_xx" files -->
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basename"><value>messages</value></property>
        </bean>
    
        <!-- JNDI DataSource for J2EE environments -->
        <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName"><value>java&#58;/DefaultDS</value></property>
        </bean>
    
        <!-- Hibernate SessionFactory -->
        <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
            <property name="dataSource"><ref local="dataSource"/></property>
            <property name="mappingResources">
                <list>
                    <value>be/vw/wc/medicalcertificate/MedicalCertificateReason.hbm.xml</value>
                    <value>be/vw/wc/workplace/Workplace.hbm.xml</value>
                    <value>be/vw/wc/location/Location.hbm.xml</value>
                    <value>be/vw/wc/cupboard/CupboardHistory.hbm.xml</value>
                    <value>be/vw/wc/article/ArticleStock.hbm.xml</value>
                    <value>be/vw/wc/article/ArticleGroup.hbm.xml</value>
                    <value>be/vw/wc/badge/Badge.hbm.xml</value>
                    <value>be/vw/wc/person/Person.hbm.xml</value>
                    <value>be/vw/wc/cloakroom/CloakRoom.hbm.xml</value>
                    <value>be/vw/wc/medicalcertificate/MedicalCertificate.hbm.xml</value>
                    <value>be/vw/wc/locker/Locker.hbm.xml</value>
                    <value>be/vw/wc/article/ArticleType.hbm.xml</value>
                    <value>be/vw/wc/physician/Physician.hbm.xml</value>
                    <value>be/vw/wc/article/ArticleMovement.hbm.xml</value>
                    <value>be/vw/wc/color/Color.hbm.xml</value>
                    <value>be/vw/wc/article/ArticleHistory.hbm.xml</value>
                    <value>be/vw/wc/team/Team.hbm.xml</value>
                    <value>be/vw/wc/locker/LockerHistory.hbm.xml</value>
                    <value>be/vw/wc/alert/Alert.hbm.xml</value>
                    <value>be/vw/wc/badge/BadgeType.hbm.xml</value>
                    <value>be/vw/wc/user/User.hbm.xml</value>
                    <value>be/vw/wc/division/Division.hbm.xml</value>
                    <value>be/vw/wc/cupboard/Cupboard.hbm.xml</value>
                    <value>be/vw/wc/department/Department.hbm.xml</value>
                    <value>be/vw/wc/article/Article.hbm.xml</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.show_sql">false</prop>
                    <prop key="hibernate.dialect">net.sf.hibernate.dialect.HSQLDialect</prop>
                    <prop key="hibernate.cache.use_query_cache">false</prop>
                    <prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.EhCacheProvider</prop>
                    <prop key="hibernate.cache.query_cache_factory">net.sf.hibernate.cache.StandardQueryCacheFactory</prop>
                </props>
            </property>
        </bean>
    
        <!-- The Hibernate interceptor -->
        <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate.HibernateInterceptor">
            <property name="sessionFactory"><ref bean="sessionFactory"/></property>
        </bean>
    
         <!-- MedicalCertificateReason Entity Proxy -->
         <bean id="medicalCertificateReasonDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="medicalCertificateReasonDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.medicalcertificate.MedicalCertificateReasonDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- MedicalCertificateReason Entity Implementation  -->
        <bean id="medicalCertificateReasonDaoTarget" class="be.vw.wc.medicalcertificate.MedicalCertificateReasonDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Workplace Entity Proxy -->
         <bean id="workplaceDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="workplaceDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.workplace.WorkplaceDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Workplace Entity Implementation  -->
        <bean id="workplaceDaoTarget" class="be.vw.wc.workplace.WorkplaceDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Location Entity Proxy -->
         <bean id="locationDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="locationDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.location.LocationDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Location Entity Implementation  -->
        <bean id="locationDaoTarget" class="be.vw.wc.location.LocationDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- CupboardHistory Entity Proxy -->
         <bean id="cupboardHistoryDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="cupboardHistoryDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.cupboard.CupboardHistoryDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- CupboardHistory Entity Implementation  -->
        <bean id="cupboardHistoryDaoTarget" class="be.vw.wc.cupboard.CupboardHistoryDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- ArticleStock Entity Proxy -->
         <bean id="articleStockDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="articleStockDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.article.ArticleStockDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- ArticleStock Entity Implementation  -->
        <bean id="articleStockDaoTarget" class="be.vw.wc.article.ArticleStockDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- ArticleGroup Entity Proxy -->
         <bean id="articleGroupDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="articleGroupDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.article.ArticleGroupDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- ArticleGroup Entity Implementation  -->
        <bean id="articleGroupDaoTarget" class="be.vw.wc.article.ArticleGroupDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
            <property name="articleType"><ref bean="articleTypeDao"/></property>
        </bean>
    
         <!-- Badge Entity Proxy -->
         <bean id="badgeDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="badgeDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.badge.BadgeDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Badge Entity Implementation  -->
        <bean id="badgeDaoTarget" class="be.vw.wc.badge.BadgeDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Person Entity Proxy -->
         <bean id="personDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="personDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.person.PersonDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Person Entity Implementation  -->
        <bean id="personDaoTarget" class="be.vw.wc.person.PersonDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
            <property name="medicalCertificate"><ref bean="medicalCertificateDao"/></property>
            <property name="badge"><ref bean="badgeDao"/></property>
            <property name="articleType"><ref bean="articleTypeDao"/></property>
            <property name="articleGroup"><ref bean="articleGroupDao"/></property>
            <property name="article"><ref bean="articleDao"/></property>
            <property name="articleStock"><ref bean="articleStockDao"/></property>
        </bean>
    
         <!-- CloakRoom Entity Proxy -->
         <bean id="cloakRoomDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="cloakRoomDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.cloakroom.CloakRoomDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- CloakRoom Entity Implementation  -->
        <bean id="cloakRoomDaoTarget" class="be.vw.wc.cloakroom.CloakRoomDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- MedicalCertificate Entity Proxy -->
         <bean id="medicalCertificateDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="medicalCertificateDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.medicalcertificate.MedicalCertificateDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- MedicalCertificate Entity Implementation  -->
        <bean id="medicalCertificateDaoTarget" class="be.vw.wc.medicalcertificate.MedicalCertificateDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Locker Entity Proxy -->
         <bean id="lockerDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="lockerDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.locker.LockerDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Locker Entity Implementation  -->
        <bean id="lockerDaoTarget" class="be.vw.wc.locker.LockerDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- ArticleType Entity Proxy -->
         <bean id="articleTypeDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="articleTypeDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.article.ArticleTypeDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- ArticleType Entity Implementation  -->
        <bean id="articleTypeDaoTarget" class="be.vw.wc.article.ArticleTypeDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Physician Entity Proxy -->
         <bean id="physicianDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="physicianDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.physician.PhysicianDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Physician Entity Implementation  -->
        <bean id="physicianDaoTarget" class="be.vw.wc.physician.PhysicianDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- ArticleMovement Entity Proxy -->
         <bean id="articleMovementDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="articleMovementDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.article.ArticleMovementDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- ArticleMovement Entity Implementation  -->
        <bean id="articleMovementDaoTarget" class="be.vw.wc.article.ArticleMovementDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Color Entity Proxy -->
         <bean id="colorDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="colorDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.color.ColorDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Color Entity Implementation  -->
        <bean id="colorDaoTarget" class="be.vw.wc.color.ColorDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- ArticleHistory Entity Proxy -->
         <bean id="articleHistoryDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="articleHistoryDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.article.ArticleHistoryDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- ArticleHistory Entity Implementation  -->
        <bean id="articleHistoryDaoTarget" class="be.vw.wc.article.ArticleHistoryDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Team Entity Proxy -->
         <bean id="teamDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="teamDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.team.TeamDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Team Entity Implementation  -->
        <bean id="teamDaoTarget" class="be.vw.wc.team.TeamDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- LockerHistory Entity Proxy -->
         <bean id="lockerHistoryDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="lockerHistoryDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.locker.LockerHistoryDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- LockerHistory Entity Implementation  -->
        <bean id="lockerHistoryDaoTarget" class="be.vw.wc.locker.LockerHistoryDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Alert Entity Proxy -->
         <bean id="alertDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="alertDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.alert.AlertDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Alert Entity Implementation  -->
        <bean id="alertDaoTarget" class="be.vw.wc.alert.AlertDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- BadgeType Entity Proxy -->
         <bean id="badgeTypeDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="badgeTypeDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.badge.BadgeTypeDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- BadgeType Entity Implementation  -->
        <bean id="badgeTypeDaoTarget" class="be.vw.wc.badge.BadgeTypeDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- User Entity Proxy -->
         <bean id="userDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="userDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.user.UserDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- User Entity Implementation  -->
        <bean id="userDaoTarget" class="be.vw.wc.user.UserDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Division Entity Proxy -->
         <bean id="divisionDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="divisionDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.division.DivisionDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Division Entity Implementation  -->
        <bean id="divisionDaoTarget" class="be.vw.wc.division.DivisionDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Cupboard Entity Proxy -->
         <bean id="cupboardDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="cupboardDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.cupboard.CupboardDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Cupboard Entity Implementation  -->
        <bean id="cupboardDaoTarget" class="be.vw.wc.cupboard.CupboardDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Department Entity Proxy -->
         <bean id="departmentDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="departmentDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.department.DepartmentDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Department Entity Implementation  -->
        <bean id="departmentDaoTarget" class="be.vw.wc.department.DepartmentDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
        </bean>
    
         <!-- Article Entity Proxy -->
         <bean id="articleDao" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="articleDaoTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.article.ArticleDao</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- Article Entity Implementation  -->
        <bean id="articleDaoTarget" class="be.vw.wc.article.ArticleDaoImpl">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
            <property name="person"><ref bean="personDao"/></property>
            <property name="articleStock"><ref bean="articleStockDao"/></property>
        </bean>
    
        <!-- ========================= Start of SERVICE DEFINITIONS ========================= -->
    
        <!-- ColorService Service Implementation  -->
        <bean id="colorServiceTarget" class="be.vw.wc.color.ColorServiceImpl">
            <property name="color"><ref bean="colorDao"/></property>
        </bean>
    
        <!-- ColorService Service Proxy  -->
        <bean id="colorService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="colorServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.color.ColorService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- StorageService Service Implementation  -->
        <bean id="storageServiceTarget" class="be.vw.wc.storage.StorageServiceImpl">
            <property name="cupboard"><ref bean="cupboardDao"/></property>
            <property name="locker"><ref bean="lockerDao"/></property>
        </bean>
    
        <!-- StorageService Service Proxy  -->
        <bean id="storageService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="storageServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.storage.StorageService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- LockerService Service Implementation  -->
        <bean id="lockerServiceTarget" class="be.vw.wc.locker.LockerServiceImpl">
            <property name="locker"><ref bean="lockerDao"/></property>
        </bean>
    
        <!-- LockerService Service Proxy  -->
        <bean id="lockerService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="lockerServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.locker.LockerService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- PersonService Service Implementation  -->
        <bean id="personServiceTarget" class="be.vw.wc.person.PersonServiceImpl">
            <property name="person"><ref bean="personDao"/></property>
            <property name="cupboardHistory"><ref bean="cupboardHistoryDao"/></property>
            <property name="lockerHistory"><ref bean="lockerHistoryDao"/></property>
            <property name="locker"><ref bean="lockerDao"/></property>
            <property name="cupboard"><ref bean="cupboardDao"/></property>
            <property name="article"><ref bean="articleDao"/></property>
            <property name="medicalCertificate"><ref bean="medicalCertificateDao"/></property>
            <property name="articleGroup"><ref bean="articleGroupDao"/></property>
        </bean>
    
        <!-- PersonService Service Proxy  -->
        <bean id="personService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="personServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.person.PersonService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- WorkplaceService Service Implementation  -->
        <bean id="workplaceServiceTarget" class="be.vw.wc.workplace.WorkplaceServiceImpl">
            <property name="workplace"><ref bean="workplaceDao"/></property>
        </bean>
    
        <!-- WorkplaceService Service Proxy  -->
        <bean id="workplaceService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="workplaceServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.workplace.WorkplaceService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- DivisionService Service Implementation  -->
        <bean id="divisionServiceTarget" class="be.vw.wc.division.DivisionServiceImpl">
            <property name="division"><ref bean="divisionDao"/></property>
        </bean>
    
        <!-- DivisionService Service Proxy  -->
        <bean id="divisionService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="divisionServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.division.DivisionService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- CloakRoomService Service Implementation  -->
        <bean id="cloakRoomServiceTarget" class="be.vw.wc.cloakroom.CloakRoomServiceImpl">
            <property name="cloakRoom"><ref bean="cloakRoomDao"/></property>
        </bean>
    
        <!-- CloakRoomService Service Proxy  -->
        <bean id="cloakRoomService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="cloakRoomServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.cloakroom.CloakRoomService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- TeamService Service Implementation  -->
        <bean id="teamServiceTarget" class="be.vw.wc.team.TeamServiceImpl">
            <property name="team"><ref bean="teamDao"/></property>
        </bean>
    
        <!-- TeamService Service Proxy  -->
        <bean id="teamService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="teamServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.team.TeamService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- LocationService Service Implementation  -->
        <bean id="locationServiceTarget" class="be.vw.wc.location.LocationServiceImpl">
            <property name="location"><ref bean="locationDao"/></property>
        </bean>
    
        <!-- LocationService Service Proxy  -->
        <bean id="locationService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="locationServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.location.LocationService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- ArticleService Service Implementation  -->
        <bean id="articleServiceTarget" class="be.vw.wc.article.ArticleServiceImpl">
            <property name="articleType"><ref bean="articleTypeDao"/></property>
            <property name="article"><ref bean="articleDao"/></property>
            <property name="articleGroup"><ref bean="articleGroupDao"/></property>
            <property name="person"><ref bean="personDao"/></property>
            <property name="articleHistory"><ref bean="articleHistoryDao"/></property>
            <property name="articleMovement"><ref bean="articleMovementDao"/></property>
            <property name="articleStock"><ref bean="articleStockDao"/></property>
        </bean>
    
        <!-- ArticleService Service Proxy  -->
        <bean id="articleService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="articleServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.article.ArticleService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- CupboardService Service Implementation  -->
        <bean id="cupboardServiceTarget" class="be.vw.wc.cupboard.CupboardServiceImpl">
            <property name="cupboard"><ref bean="cupboardDao"/></property>
            <property name="cloakRoom"><ref bean="cloakRoomDao"/></property>
        </bean>
    
        <!-- CupboardService Service Proxy  -->
        <bean id="cupboardService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="cupboardServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.cupboard.CupboardService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- UserService Service Implementation  -->
        <bean id="userServiceTarget" class="be.vw.wc.user.UserServiceImpl">
            <property name="user"><ref bean="userDao"/></property>
        </bean>
    
        <!-- UserService Service Proxy  -->
        <bean id="userService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="userServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.user.UserService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- DepartmentService Service Implementation  -->
        <bean id="departmentServiceTarget" class="be.vw.wc.department.DepartmentServiceImpl">
            <property name="department"><ref bean="departmentDao"/></property>
        </bean>
    
        <!-- DepartmentService Service Proxy  -->
        <bean id="departmentService" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref bean="departmentServiceTarget"/></property>
             <property name="proxyInterfaces">
                 <value>be.vw.wc.department.DepartmentService</value>
             </property>
             <property name="interceptorNames">
                 <list>
                     <value>hibernateInterceptor</value>
                 </list>
             </property>
         </bean>
    
        <!-- ========================= End of SERVICE DEFINITIONS ========================= -->
    
    </beans>

  • #2
    I am getting the same error, although perhaps for a different reason, as detailed in thread:

    http://forum.springframework.org/showthread.php?t=12798

    The problem I am having is when two proxied objects depend on each other. Hence, only a problem with some beans.
    Last edited by robyn; May 19th, 2006, 06:00 AM.

    Comment


    • #3
      I'm helping Wouter out trying to debug this issue. And you're right it does occur when two proxied beans reference each other, if you look at the applicationContext.xml Wouter has pasted, you'll see

      Code:
          <bean id="articleDaoTarget" class="be.vw.wc.article.ArticleDaoImpl">
              <property name="sessionFactory"><ref local="sessionFactory"/></property>
              <property name="person"><ref bean="personDao"/></property>
              <property name="articleStock"><ref bean="articleStockDao"/></property>
          </bean>
      and

      Code:
          <bean id="personDaoTarget" class="be.vw.wc.person.PersonDaoImpl">
              <property name="sessionFactory"><ref local="sessionFactory"/></property>
              <property name="medicalCertificate"><ref bean="medicalCertificateDao"/></property>
              <property name="badge"><ref bean="badgeDao"/></property>
              <property name="articleType"><ref bean="articleTypeDao"/></property>
              <property name="articleGroup"><ref bean="articleGroupDao"/></property>
              <property name="articleStock"><ref bean="articleStockDao"/></property>
              <property name="article"><ref bean="articleDao"/></property>
          </bean>
      which do reference each other.

      If I remove "</property>
      <property name="article"><ref bean="articleDao"/></property>" from personDaoTarget, when spring initializes, there are no problems, if I remove "<property name="person"><ref bean="personDao"/></property>" from articleDaoTarget then again when spring initializes there are no problems.

      So it looks like if I remove either property reference from one or the other (it doesn't matter which) then spring initializes fine, so sounds like the same thing you're running into. I'm surprised more people haven't run into this?

      I've also seen the error (not on Wouter's project) when I had a long class name when running on windows (for one of my services), I shortened the service name and the problem went away.

      Comment


      • #4
        When I set default-autowire="byType" or "autodetect" (when I have 2 beans that reference each other), I get an infinite loop while spring initializes, sounds like a bug to me.

        Comment


        • #5
          I filed this in JIRA a few days ago. It would be great if you add this information to that JIRA and voted for it's resolution (solidarity and all) :wink:

          The JIRA is SPR-689

          Cheers
          Steve

          Comment


          • #6
            Will do..thanks for the info.

            Comment


            • #8
              I think (?) there have been previous posts similar to this.

              The workaround seemed to be to use a BeanPostProcessor to complete the bean references.

              e.g. if A references B, and B references A, then retain the Spring config where B is injected into A, and then create a BeanPostProcessor that looks for A and manually sets it into B.

              If you do a search for BeanPostProcessor, you'll probably be able to find the posts easily.

              Comment


              • #9
                Thanks for the reference, I see that now. I didn't make the connection (duh) before that when I added advice to my "normal" bean it suddenly became a "factory" bean and so this problem kicks in.

                Regardless, I think it's a good idea to have the JIRA in place, it really ought to be addressed if at all possible. Everyone is going to get tripped up on this as it gets introduced randomly during the development process.

                As my bean definitions are generated automatically, I have to go back and see how I can reconize this situation. Chances are I won't be able to figure it out for all cases and will need to change my DAO classes to incorporate the advice directly rather then using Spring AOP for this. ughhh....

                Cheers
                Steve

                Comment


                • #10
                  Well doing a search for "BeanPostProcessor" I found this post: http://forum.springframework.org/showthread.php?t=10982 which offered a couple suggestions for a work-a-round. I implemented the lookup-method option, so replacing the regular property references for the circular dependencies with

                  <lookup-method name="getArticleDao" bean="articleDao"/>

                  and

                  <lookup-method name="getPersonDao" bean="personDao"/>

                  fixed the problem. Thanks for the help! However I agree this really should be fixed as it's not obvious why it doesn't work.
                  Last edited by robyn; May 19th, 2006, 06:01 AM.

                  Comment

                  Working...
                  X