|
From: <jue...@we...> - 2004-03-17 18:23:57
|
I've just fixed a bug in AbstractAutoProxyCreator today (reported by = Cameron Braid), where common interceptors were initialized too eagerly, = potentially causing implicit circular references. So please check out = the current CVS version: There's a good chance that you're issue is = fixed there. This will of course also make it into the upcoming Spring = 1.0 final. Juergen -----Original Message----- From: spr...@li... = [mailto:spr...@li...]On Behalf = Of Andre Vermeulen Sent: Wednesday, March 17, 2004 3:15 PM To: spr...@li... Subject: [Springframework-developer] AutoProxy+Hibernate 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 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 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. Any pointers ? Something obvious I am missing ? Or is it just a CR... This problem seem similar to Cameron Braid problem as... = http://sourceforge.net/mailarchive/message.php?msg_id=3D7536635 Did you solve your problem Cameron ?? Any help will be appreciated - I will see whta I can figure out in the = mean while. regards andre=20 AutoProxys : ************** <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> <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> Advices :=20 ********** <bean id=3D"createAuditInfoAdvice" = class=3D"com.cablenet.datasync.interceptors.HibernateCreateAuditInfoAdvic= e"> <property name=3D"sessionFactory" > <ref bean=3D"sessionFactory"/> </property> <property name=3D"uuidGenerator" > <ref bean=3D"keyGenerator"/> </property> </bean> <bean id=3D"deleteAuditInfoAdvice" = class=3D"com.cablenet.datasync.interceptors.HibernateDeleteAuditInfoAdvic= e"> <property name=3D"sessionFactory" > <ref bean=3D"sessionFactory"/> </property> </bean> Exception : ************ 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) |