|
From: Andre V. <ave...@su...> - 2004-03-17 14:14:52
|
=20 I have two AutoProxy instances createAuditInfoProxyCreator and = deleteAuditInfoProxyCreator, which wrap some of my classes with = Interceptors. The two interceptors I am using is createAuditInfoAdvice and = deleteAuditInfoAdvice. The configuration settings is below.=20 =20 I have an implementation which use the same AutoProxies, but it is using = SQLMap which works fine - I am not using SQLMapTemplate at the moment = for this implemetation. Now have I written the same functionality as my = previous SQLMap implemetation, but using Hibernate and HibernateTemplate = (no Transaction support at the moment). I can include one of the = AutoProxies instances to the Hibernate implementation and it will work = fine. But as soon as I add both the AutoProxies I get a exception = (org.springframework.beans.factory.FactoryBeanCircularReferenceException)= .=20 =20 I am not sure whether I unstand the concept of a = FactoryBeanCircularReferenceException 100%, but both my iterceptors are = using a Hibernate SessionFactory - this should not be a problem ?? I = will include the whole tacktrace below. =20 =20 =20 Any pointers ? Something obvious I am missing ? Or is it just a CR... =20 This problem seem similar to Cameron Braid problem as... = http://sourceforge.net/mailarchive/message.php?msg_id=3D7536635 =20 Did you solve your problem Cameron ?? =20 Any help will be appreciated - I will see whta I can figure out in the = mean while. =20 regards =20 andre=20 =20 AutoProxys : ************** =20 <bean id=3D"createAuditInfoProxyCreator" = class=3D"org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCre= ator"> <property name=3D"proxyTargetClass"> <value>true</value> </property> <property name=3D"beanNames"> <value>*FetchRule</value> </property> <property name=3D"interceptorNames"> <list> <value>createAuditInfoAdvice</value> </list> </property> </bean> =20 <bean id=3D"deleteAuditInfoProxyCreator" = class=3D"org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCre= ator"> <property name=3D"proxyTargetClass"> <value>true</value> </property> <property name=3D"beanNames"> <value>*ConfirmRule</value> </property> <property name=3D"interceptorNames"> <list> <value>deleteAuditInfoAdvice</value> </list> </property> </bean> =20 =20 Advices :=20 ********** <bean id=3D"createAuditInfoAdvice" = class=3D"com.cablenet.datasync.interceptors.HibernateCreateAuditInfoAdvic= e"> <property name=3D"sessionFactory" > <ref bean=3D"sessionFactory"/> </property> =20 <property name=3D"uuidGenerator" > <ref bean=3D"keyGenerator"/> </property> </bean> =20 <bean id=3D"deleteAuditInfoAdvice" = class=3D"com.cablenet.datasync.interceptors.HibernateDeleteAuditInfoAdvic= e"> <property name=3D"sessionFactory" > <ref bean=3D"sessionFactory"/> </property> </bean> =20 Exception : ************ =20 Testcase: = testExecute(com.cablenet.datasync.rules.hibernate.test.TestHibernateConfi= rmRule): Caused an ERROR Error creating bean with name 'confirmReplyListener' defined in = classpath resource [appConfig.xml]: Can't resolve reference to bean = 'confirmRuleRegistry' while setting property 'constructor argument'; = nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'confirmRuleRegistry' defined in classpath resource = [appConfig.xml]: Initialization method of bean failed; nested exception = is org.springframework.beans.factory.BeanCreationException: Error = creating bean with name 'createAuditInfoAdvice' defined in classpath = resource [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is org.springframework.beans.factory.BeanCreationException: = Error creating bean with name 'sessionFactory' defined in classpath = resource [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'cnDS' while setting property 'dataSource'; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'cnDS' defined in classpath resource [appConfig.xml]: = Initialization method of bean failed; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'deleteAuditInfoAdvice' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is = org.springframework.beans.factory.FactoryBeanCircularReferenceException: = Factory bean 'sessionFactory' returned null object - possible cause: not = fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'confirmReplyListener' defined in classpath resource = [appConfig.xml]: Can't resolve reference to bean 'confirmRuleRegistry' = while setting property 'constructor argument'; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'confirmRuleRegistry' defined in classpath resource = [appConfig.xml]: Initialization method of bean failed; nested exception = is org.springframework.beans.factory.BeanCreationException: Error = creating bean with name 'createAuditInfoAdvice' defined in classpath = resource [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is org.springframework.beans.factory.BeanCreationException: = Error creating bean with name 'sessionFactory' defined in classpath = resource [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'cnDS' while setting property 'dataSource'; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'cnDS' defined in classpath resource [appConfig.xml]: = Initialization method of bean failed; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'deleteAuditInfoAdvice' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is = org.springframework.beans.factory.FactoryBeanCircularReferenceException: = Factory bean 'sessionFactory' returned null object - possible cause: not = fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'confirmRuleRegistry' defined in classpath resource = [appConfig.xml]: Initialization method of bean failed; nested exception = is org.springframework.beans.factory.BeanCreationException: Error = creating bean with name 'createAuditInfoAdvice' defined in classpath = resource [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is org.springframework.beans.factory.BeanCreationException: = Error creating bean with name 'sessionFactory' defined in classpath = resource [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'cnDS' while setting property 'dataSource'; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'cnDS' defined in classpath resource [appConfig.xml]: = Initialization method of bean failed; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'deleteAuditInfoAdvice' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is = org.springframework.beans.factory.FactoryBeanCircularReferenceException: = Factory bean 'sessionFactory' returned null object - possible cause: not = fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'createAuditInfoAdvice' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is org.springframework.beans.factory.BeanCreationException: = Error creating bean with name 'sessionFactory' defined in classpath = resource [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'cnDS' while setting property 'dataSource'; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'cnDS' defined in classpath resource [appConfig.xml]: = Initialization method of bean failed; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'deleteAuditInfoAdvice' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is = org.springframework.beans.factory.FactoryBeanCircularReferenceException: = Factory bean 'sessionFactory' returned null object - possible cause: not = fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'sessionFactory' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean 'cnDS' while = setting property 'dataSource'; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'cnDS' defined in classpath resource [appConfig.xml]: = Initialization method of bean failed; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'deleteAuditInfoAdvice' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is = org.springframework.beans.factory.FactoryBeanCircularReferenceException: = Factory bean 'sessionFactory' returned null object - possible cause: not = fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'cnDS' defined in classpath resource [appConfig.xml]: = Initialization method of bean failed; nested exception is = org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'deleteAuditInfoAdvice' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is = org.springframework.beans.factory.FactoryBeanCircularReferenceException: = Factory bean 'sessionFactory' returned null object - possible cause: not = fully initialized due to circular bean reference org.springframework.beans.factory.BeanCreationException: Error creating = bean with name 'deleteAuditInfoAdvice' defined in classpath resource = [appConfig-Hibernate.xml]: Can't resolve reference to bean = 'sessionFactory' while setting property 'sessionFactory'; nested = exception is = org.springframework.beans.factory.FactoryBeanCircularReferenceException: = Factory bean 'sessionFactory' returned null object - possible cause: not = fully initialized due to circular bean reference org.springframework.beans.factory.FactoryBeanCircularReferenceException: = Factory bean 'sessionFactory' returned null object - possible cause: not = fully initialized due to circular bean reference at = org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFo= rSharedInstance(AbstractBeanFactory.java:444) at = org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs= tractBeanFactory.java:124) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.resolveReference(AbstractAutowireCapableBeanFactory.java:585) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:553) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:506) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.populateBean(AbstractAutowireCapableBeanFactory.java:361) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.createBean(AbstractAutowireCapableBeanFactory.java:150) at = org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs= tractBeanFactory.java:142) at = org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.reso= lveInterceptorNames(AbstractAutoProxyCreator.java:240) at = org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.post= ProcessAfterInitialization(AbstractAutoProxyCreator.java:188) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBea= nFactory.java:111) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.createBean(AbstractAutowireCapableBeanFactory.java:172) at = org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs= tractBeanFactory.java:142) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.resolveReference(AbstractAutowireCapableBeanFactory.java:585) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:553) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:506) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.populateBean(AbstractAutowireCapableBeanFactory.java:361) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.createBean(AbstractAutowireCapableBeanFactory.java:150) at = org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs= tractBeanFactory.java:142) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.resolveReference(AbstractAutowireCapableBeanFactory.java:585) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:553) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:506) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.populateBean(AbstractAutowireCapableBeanFactory.java:361) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.createBean(AbstractAutowireCapableBeanFactory.java:150) at = org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs= tractBeanFactory.java:142) at = org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.reso= lveInterceptorNames(AbstractAutoProxyCreator.java:240) at = org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.post= ProcessAfterInitialization(AbstractAutoProxyCreator.java:188) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBea= nFactory.java:111) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.createBean(AbstractAutowireCapableBeanFactory.java:172) at = org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs= tractBeanFactory.java:142) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.resolveReference(AbstractAutowireCapableBeanFactory.java:585) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:553) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:222) at = org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact= ory.createBean(AbstractAutowireCapableBeanFactory.java:136) at = org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abs= tractBeanFactory.java:142) at = org.springframework.beans.factory.support.DefaultListableBeanFactory.preI= nstantiateSingletons(DefaultListableBeanFactory.java:159) at = org.springframework.context.support.AbstractApplicationContext.refresh(Ab= stractApplicationContext.java:268) at = org.springframework.context.support.FileSystemXmlApplicationContext.<init= >(FileSystemXmlApplicationContext.java:42) at = org.springframework.context.support.ClassPathXmlApplicationContext.<init>= (ClassPathXmlApplicationContext.java:40) at com.cablenet.datasync.AppContext.getAppContextHibernate(Unknown = Source) at = com.cablenet.datasync.rules.hibernate.test.TestHibernateConfirmRule.testE= xecute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) |