|
From: Ross M. <ro...@at...> - 2003-12-16 00:00:14
|
Hi j=FCrgen, We were using refresh as we needed to defer the initialisation of the=20 String container the first time our app is run until the user has setup=20 their db settings, at which point we initialise the container. After=20 that, if/when the server is restarted we use your ContextLoaderListener=20 is used to initialise the container. I think I've just realised what the problem is. We have 3=20 applicationContexts and the bean causing the error is defined in a=20 different context. Is there a way to autowire over multiple contexts? If this is the case, the exception for this scenario is a bit misleading=20 as it tells me there is more than one satifiable dependency. The exception we get is - org.springframework.beans.FatalBeanException: Can't resolve reference to=20 bean 'notifierCreatePage' while setting property 'listeners[0]' on bean=20 'producerCreatePage'; nested exception is:=20 org.springframework.beans.factory.UnsatisfiedDependencyException: Bean=20 with name 'notifierCreatePage' has an unsatisfied dependency expressed=20 through property 'emailTemplateManager': set this property value or=20 disable dependency checking for this bean; detail message =3D [There are = 2=20 beans of type [interface=20 com.atlassian.confluence.mail.template.EmailTemplateManager] for=20 autowire by type. There should have been 1 to be able to autowire=20 property 'emailTemplateManager' of bean 'notifierCreatePage'.] (This is very informative excetion BTW ;-)) Cheers, Ross j=FCrgen h=F6ller [werk3AT] wrote: > Hi Ross, > =20 > "refresh" is now in ConfigurableApplicationContext, but you shouldn't n= eed that for typical usages anyway. I guess what you're trying to do is c= ustom initialization of the root WebApplicationContext, storing it in a c= ustom place via the setApplicationContext call. That should be fine: I su= ppose that the error you're getting has other origins. Autowiring has bee= n significantly reworked; could you check for which components you get mo= re than one matching bean? The reason could be that you actually *have* m= ultiple matching beans, which just weren't found by M2's autowire impleme= ntation, maybe due to being created by FactoryBeans. Could you quote rele= vant parts of your configuration? > =20 > Juergen > =20 >=20 > ________________________________ >=20 > Von: spr...@li... im Auftrag v= on Ross Mason > Gesendet: Mo 15.12.2003 07:50 > An: spr...@li... > Betreff: [Springframework-developer] Refreshing the ApplicationContext.= .. >=20 >=20 >=20 > Hi, >=20 > In the latest source the ApplicationContext.refresh() method has been > removed. What is the recommended way of refreshing an > applicationContext now. I'm trying - >=20 > ContextLoader loader =3D new ContextLoader(); > setApplicationContext( > loader.initWebApplicationContext(servletContext) ); >=20 > But I am getting an error saying that there is more than one matching > bean on some components when autoWiring by type. Our code and cofig > works fine with M2 release, but we're mored to the latest source to mak= e > use of the OpenSessionInViewFilter. >=20 > Any ideas? >=20 >=20 > Cheers, >=20 > Ross >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM= 's > Free Linux Tutorials. Learn everything from the bash shell to sys admi= n. > Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM= 's > Free Linux Tutorials. Learn everything from the bash shell to sys admi= n. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=CCk > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 |