|
From: <jue...@we...> - 2003-12-15 07:15:16
|
Hi Ross,
=20
"refresh" is now in ConfigurableApplicationContext, but you shouldn't =
need that for typical usages anyway. I guess what you're trying to do is =
custom initialization of the root WebApplicationContext, storing it in a =
custom place via the setApplicationContext call. That should be fine: I =
suppose that the error you're getting has other origins. Autowiring has =
been significantly reworked; could you check for which components you =
get more than one matching bean? The reason could be that you actually =
*have* multiple matching beans, which just weren't found by M2's =
autowire implementation, maybe due to being created by FactoryBeans. =
Could you quote relevant parts of your configuration?
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Ross Mason
Gesendet: Mo 15.12.2003 07:50
An: spr...@li...
Betreff: [Springframework-developer] Refreshing the =
ApplicationContext...
Hi,
In the latest source the ApplicationContext.refresh() method has been
removed. What is the recommended way of refreshing an
applicationContext now. I'm trying -
ContextLoader loader =3D new ContextLoader();
setApplicationContext(
loader.initWebApplicationContext(servletContext) );
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 make
use of the OpenSessionInViewFilter.
Any ideas?
Cheers,
Ross
-------------------------------------------------------
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 =
admin.
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
|
|
From: <jue...@we...> - 2003-12-16 00:49:32
|
Ross, =20 If you build a single context from multiple files, autowiring will = automatically scan all the bean definitions in those files. In your = case, I assume that you do have multiple definitions of type = EmailTemplateManager, possibly in two different context files. You could = check that programmatically by examining the result of = ApplicationContext.getBeansOfType(EmailTemplateManager.class, true, = true). =20 In any case, even if you apply autowiring in general, you can always = override a specific dependency, like an explicit bean reference from = property "emailTemplateManager" of bean "notifierCreatePage" to a = specific bean of type EmailTemplateManager: =20 <bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> <property name=3D"emailTemplateManager"><ref = bean=3D"myEmailTemplateManager"/></property> ... </bean> =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Ross Mason Gesendet: Di 16.12.2003 01:00 An: spr...@li... Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... Hi j=FCrgen, We were using refresh as we needed to defer the initialisation of the String container the first time our app is run until the user has setup their db settings, at which point we initialise the container. After that, if/when the server is restarted we use your ContextLoaderListener is used to initialise the container. I think I've just realised what the problem is. We have 3 applicationContexts and the bean causing the error is defined in a 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 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 bean 'notifierCreatePage' while setting property 'listeners[0]' on bean 'producerCreatePage'; nested exception is: org.springframework.beans.factory.UnsatisfiedDependencyException: Bean with name 'notifierCreatePage' has an unsatisfied dependency expressed through property 'emailTemplateManager': set this property value or disable dependency checking for this bean; detail message =3D [There are = 2 beans of type [interface com.atlassian.confluence.mail.template.EmailTemplateManager] for autowire by type. There should have been 1 to be able to autowire 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 = need that for typical usages anyway. I guess what you're trying to do is = custom initialization of the root WebApplicationContext, storing it in a = custom place via the setApplicationContext call. That should be fine: I = suppose that the error you're getting has other origins. Autowiring has = been significantly reworked; could you check for which components you = get more than one matching bean? The reason could be that you actually = *have* multiple matching beans, which just weren't found by M2's = autowire implementation, maybe due to being created by FactoryBeans. = Could you quote relevant parts of your configuration? >=20 > Juergen >=20 > > ________________________________ > > Von: spr...@li... im Auftrag = von Ross Mason > Gesendet: Mo 15.12.2003 07:50 > An: spr...@li... > Betreff: [Springframework-developer] Refreshing the = ApplicationContext... > > > > Hi, > > In the latest source the ApplicationContext.refresh() method has been > removed. What is the recommended way of refreshing an > applicationContext now. I'm trying - > > ContextLoader loader =3D new ContextLoader(); > setApplicationContext( > loader.initWebApplicationContext(servletContext) ); > > 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 = make > use of the OpenSessionInViewFilter. > > Any ideas? > > > Cheers, > > Ross > > > > ------------------------------------------------------- > 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 = admin. > 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 > > > > > ------------------------------------------------------- > 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 = admin. > 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 > ------------------------------------------------------- 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 = admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Ross M. <ro...@at...> - 2003-12-16 01:23:06
|
Hi j=FCrgen, When I run getBeansOfType() on our config (turning off autowireByType) I=20 do get two beans returned: - I get the emialTemplateManager as expected (this is a proxy=20 org.springframework.transaction.interceptor.TransactionProxyFactoryBean). - I also get back our emailTemplateManagerTarget which is our proxied=20 object. This suggests you can't use autowireByType when using=20 TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this=20 intended behaviour? Cheers, Ross j=FCrgen h=F6ller [werk3AT] wrote: > Ross, > =20 > If you build a single context from multiple files, autowiring will auto= matically scan all the bean definitions in those files. In your case, I a= ssume that you do have multiple definitions of type EmailTemplateManager,= possibly in two different context files. You could check that programmat= ically by examining the result of ApplicationContext.getBeansOfType(Email= TemplateManager.class, true, true). > =20 > In any case, even if you apply autowiring in general, you can always ov= erride a specific dependency, like an explicit bean reference from proper= ty "emailTemplateManager" of bean "notifierCreatePage" to a specific bean= of type EmailTemplateManager: > =20 > <bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> > <property name=3D"emailTemplateManager"><ref bean=3D"myEmailTemplateM= anager"/></property> > ... > </bean> > =20 > Juergen > =20 >=20 > ________________________________ >=20 > Von: spr...@li... im Auftrag v= on Ross Mason > Gesendet: Di 16.12.2003 01:00 > An: spr...@li... > Betreff: Re: [Springframework-developer] Refreshing the ApplicationCont= ext... >=20 >=20 >=20 > Hi j=FCrgen, >=20 > We were using refresh as we needed to defer the initialisation of the > String container the first time our app is run until the user has setup > their db settings, at which point we initialise the container. After > that, if/when the server is restarted we use your ContextLoaderListener > is used to initialise the container. >=20 > I think I've just realised what the problem is. We have 3 > applicationContexts and the bean causing the error is defined in a > different context. Is there a way to autowire over multiple contexts? >=20 > If this is the case, the exception for this scenario is a bit misleadin= g > as it tells me there is more than one satifiable dependency. >=20 > The exception we get is - > org.springframework.beans.FatalBeanException: Can't resolve reference t= o > bean 'notifierCreatePage' while setting property 'listeners[0]' on bean > 'producerCreatePage'; nested exception is: > org.springframework.beans.factory.UnsatisfiedDependencyException: Bean > with name 'notifierCreatePage' has an unsatisfied dependency expressed > through property 'emailTemplateManager': set this property value or > disable dependency checking for this bean; detail message =3D [There ar= e 2 > beans of type [interface > com.atlassian.confluence.mail.template.EmailTemplateManager] for > autowire by type. There should have been 1 to be able to autowire > property 'emailTemplateManager' of bean 'notifierCreatePage'.] > (This is very informative excetion BTW ;-)) >=20 > Cheers, >=20 > Ross >=20 >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>Hi Ross, >> >>"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? >> >>Juergen >> >> >>________________________________ >> >>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.= .. >> >> >> >>Hi, >> >>In the latest source the ApplicationContext.refresh() method has been >>removed. What is the recommended way of refreshing an >>applicationContext now. I'm trying - >> >> ContextLoader loader =3D new ContextLoader(); >> setApplicationContext( >>loader.initWebApplicationContext(servletContext) ); >> >>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. >> >>Any ideas? >> >> >>Cheers, >> >>Ross >> >> >> >>------------------------------------------------------- >>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 >> >> >> >> >>------------------------------------------------------- >>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 >=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=3Dick > _______________________________________________ > 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 |
|
From: <jue...@we...> - 2003-12-16 02:26:04
|
I could have thought of that if it wasn't already so late (3:20 in the = morning now). Yes, that's a known limitation: If you proxy an object, = both the proxy and the target object will match the type. You need to = resort to explicit references for such beans - as I said, this will even = work for specific references if you apply autowire-by-type in general. =20 BTW, have I mentioned that writing a book is *damn hard work*? ;-) =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Ross Mason Gesendet: Di 16.12.2003 02:23 An: spr...@li... Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... Hi j=FCrgen, When I run getBeansOfType() on our config (turning off autowireByType) I do get two beans returned: - I get the emialTemplateManager as expected (this is a proxy org.springframework.transaction.interceptor.TransactionProxyFactoryBean).= - I also get back our emailTemplateManagerTarget which is our proxied object. This suggests you can't use autowireByType when using TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this intended behaviour? Cheers, Ross j=FCrgen h=F6ller [werk3AT] wrote: > Ross, >=20 > If you build a single context from multiple files, autowiring will = automatically scan all the bean definitions in those files. In your = case, I assume that you do have multiple definitions of type = EmailTemplateManager, possibly in two different context files. You could = check that programmatically by examining the result of = ApplicationContext.getBeansOfType(EmailTemplateManager.class, true, = true). >=20 > In any case, even if you apply autowiring in general, you can always = override a specific dependency, like an explicit bean reference from = property "emailTemplateManager" of bean "notifierCreatePage" to a = specific bean of type EmailTemplateManager: >=20 > <bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> > <property name=3D"emailTemplateManager"><ref = bean=3D"myEmailTemplateManager"/></property> > ... > </bean> >=20 > Juergen >=20 > > ________________________________ > > Von: spr...@li... im Auftrag = von Ross Mason > Gesendet: Di 16.12.2003 01:00 > An: spr...@li... > Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... > > > > Hi j=FCrgen, > > We were using refresh as we needed to defer the initialisation of the > String container the first time our app is run until the user has = setup > their db settings, at which point we initialise the container. After > that, if/when the server is restarted we use your = ContextLoaderListener > is used to initialise the container. > > I think I've just realised what the problem is. We have 3 > applicationContexts and the bean causing the error is defined in a > 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 > 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 > bean 'notifierCreatePage' while setting property 'listeners[0]' on = bean > 'producerCreatePage'; nested exception is: > org.springframework.beans.factory.UnsatisfiedDependencyException: Bean > with name 'notifierCreatePage' has an unsatisfied dependency expressed > through property 'emailTemplateManager': set this property value or > disable dependency checking for this bean; detail message =3D [There = are 2 > beans of type [interface > com.atlassian.confluence.mail.template.EmailTemplateManager] for > autowire by type. There should have been 1 to be able to autowire > property 'emailTemplateManager' of bean 'notifierCreatePage'.] > (This is very informative excetion BTW ;-)) > > Cheers, > > Ross > > > j=FCrgen h=F6ller [werk3AT] wrote: > > >>Hi Ross, >> >>"refresh" is now in ConfigurableApplicationContext, but you shouldn't = need that for typical usages anyway. I guess what you're trying to do is = custom initialization of the root WebApplicationContext, storing it in a = custom place via the setApplicationContext call. That should be fine: I = suppose that the error you're getting has other origins. Autowiring has = been significantly reworked; could you check for which components you = get more than one matching bean? The reason could be that you actually = *have* multiple matching beans, which just weren't found by M2's = autowire implementation, maybe due to being created by FactoryBeans. = Could you quote relevant parts of your configuration? >> >>Juergen >> >> >>________________________________ >> >>Von: spr...@li... im Auftrag = von Ross Mason >>Gesendet: Mo 15.12.2003 07:50 >>An: spr...@li... >>Betreff: [Springframework-developer] Refreshing the = ApplicationContext... >> >> >> >>Hi, >> >>In the latest source the ApplicationContext.refresh() method has been >>removed. What is the recommended way of refreshing an >>applicationContext now. I'm trying - >> >> ContextLoader loader =3D new ContextLoader(); >> setApplicationContext( >>loader.initWebApplicationContext(servletContext) ); >> >>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 = make >>use of the OpenSessionInViewFilter. >> >>Any ideas? >> >> >>Cheers, >> >>Ross >> >> >> >>------------------------------------------------------- >>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 = admin. >>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 >> >> >> >> >>------------------------------------------------------- >>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 = admin. >>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 >> > > > > > ------------------------------------------------------- > 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 = admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > 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 = admin. > 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 > ------------------------------------------------------- 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 = admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Ross M. <ro...@at...> - 2003-12-16 02:39:03
|
Ok mate, sounds like it's time for you to hit the sack. BTW What's the book? you can tell me in the morning ;-) Cheers, Ross j=FCrgen h=F6ller [werk3AT] wrote: > I could have thought of that if it wasn't already so late (3:20 in the = morning now). Yes, that's a known limitation: If you proxy an object, bot= h the proxy and the target object will match the type. You need to resort= to explicit references for such beans - as I said, this will even work f= or specific references if you apply autowire-by-type in general. > =20 > BTW, have I mentioned that writing a book is *damn hard work*? ;-) > =20 > Juergen > =20 >=20 > ________________________________ >=20 > Von: spr...@li... im Auftrag v= on Ross Mason > Gesendet: Di 16.12.2003 02:23 > An: spr...@li... > Betreff: Re: [Springframework-developer] Refreshing the ApplicationCont= ext... >=20 >=20 >=20 > Hi j=FCrgen, >=20 > When I run getBeansOfType() on our config (turning off autowireByType) = I > do get two beans returned: > - I get the emialTemplateManager as expected (this is a proxy > org.springframework.transaction.interceptor.TransactionProxyFactoryBean= ). > - I also get back our emailTemplateManagerTarget which is our proxied > object. >=20 > This suggests you can't use autowireByType when using > TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this > intended behaviour? >=20 > Cheers, >=20 > Ross >=20 >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>Ross, >> >>If you build a single context from multiple files, autowiring will auto= matically scan all the bean definitions in those files. In your case, I a= ssume that you do have multiple definitions of type EmailTemplateManager,= possibly in two different context files. You could check that programmat= ically by examining the result of ApplicationContext.getBeansOfType(Email= TemplateManager.class, true, true). >> >>In any case, even if you apply autowiring in general, you can always ov= erride a specific dependency, like an explicit bean reference from proper= ty "emailTemplateManager" of bean "notifierCreatePage" to a specific bean= of type EmailTemplateManager: >> >><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >> <property name=3D"emailTemplateManager"><ref bean=3D"myEmailTemplateM= anager"/></property> >> ... >></bean> >> >>Juergen >> >> >>________________________________ >> >>Von: spr...@li... im Auftrag v= on Ross Mason >>Gesendet: Di 16.12.2003 01:00 >>An: spr...@li... >>Betreff: Re: [Springframework-developer] Refreshing the ApplicationCont= ext... >> >> >> >>Hi j=FCrgen, >> >>We were using refresh as we needed to defer the initialisation of the >>String container the first time our app is run until the user has setup >>their db settings, at which point we initialise the container. After >>that, if/when the server is restarted we use your ContextLoaderListener >>is used to initialise the container. >> >>I think I've just realised what the problem is. We have 3 >>applicationContexts and the bean causing the error is defined in a >>different context. Is there a way to autowire over multiple contexts? >> >>If this is the case, the exception for this scenario is a bit misleadin= g >>as it tells me there is more than one satifiable dependency. >> >>The exception we get is - >>org.springframework.beans.FatalBeanException: Can't resolve reference t= o >>bean 'notifierCreatePage' while setting property 'listeners[0]' on bean >>'producerCreatePage'; nested exception is: >>org.springframework.beans.factory.UnsatisfiedDependencyException: Bean >>with name 'notifierCreatePage' has an unsatisfied dependency expressed >>through property 'emailTemplateManager': set this property value or >>disable dependency checking for this bean; detail message =3D [There ar= e 2 >>beans of type [interface >>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>autowire by type. There should have been 1 to be able to autowire >>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>(This is very informative excetion BTW ;-)) >> >>Cheers, >> >>Ross >> >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>Hi Ross, >>> >>>"refresh" is now in ConfigurableApplicationContext, but you shouldn't = need that for typical usages anyway. I guess what you're trying to do is = custom initialization of the root WebApplicationContext, storing it in a = custom place via the setApplicationContext call. That should be fine: I s= uppose that the error you're getting has other origins. Autowiring has be= en significantly reworked; could you check for which components you get m= ore than one matching bean? The reason could be that you actually *have* = multiple matching beans, which just weren't found by M2's autowire implem= entation, maybe due to being created by FactoryBeans. Could you quote rel= evant parts of your configuration? >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag = von Ross Mason >>>Gesendet: Mo 15.12.2003 07:50 >>>An: spr...@li... >>>Betreff: [Springframework-developer] Refreshing the ApplicationContext= ... >>> >>> >>> >>>Hi, >>> >>>In the latest source the ApplicationContext.refresh() method has been >>>removed. What is the recommended way of refreshing an >>>applicationContext now. I'm trying - >>> >>> ContextLoader loader =3D new ContextLoader(); >>> setApplicationContext( >>>loader.initWebApplicationContext(servletContext) ); >>> >>>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 ma= ke >>>use of the OpenSessionInViewFilter. >>> >>>Any ideas? >>> >>> >>>Cheers, >>> >>>Ross >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dclic= k >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>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 >>> >> >> >> >> >>------------------------------------------------------- >>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=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> >>------------------------------------------------------- >>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 >=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=3Dick > _______________________________________________ > 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 |
|
From: <jue...@we...> - 2003-12-16 15:17:13
|
It's "J2EE Development Without EJB", co-authored by Rod and me, the = follow-up to Rod's "J2EE Design and Development". Editing deadline is = mid January, so you can guess that we're quite busy! Of course, the book uses Spring for all examples - but it is an = architecture book, not a Spring tutorial. A dedicated Spring book will = follow later next year :-) BTW, does the OpenSessionInViewFilter work for you? If there are any = issues with it, please tell me before the M4 release... Finally, is there some documentation on the "external-ref" mechanism = that you use for XWork/Spring integration? We will probably refer to = that in Spring docs and the book, so I'd like to make sure that we get = the syntax right. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Ross Mason Sent: Tuesday, December 16, 2003 3:39 AM To: spr...@li... Subject: Re: [Springframework-developer] Refreshing the ApplicationContext... Ok mate, sounds like it's time for you to hit the sack. BTW What's the book? you can tell me in the morning ;-) Cheers, Ross j=FCrgen h=F6ller [werk3AT] wrote: > I could have thought of that if it wasn't already so late (3:20 in the = morning now). Yes, that's a known limitation: If you proxy an object, = both the proxy and the target object will match the type. You need to = resort to explicit references for such beans - as I said, this will even = work for specific references if you apply autowire-by-type in general. > =20 > BTW, have I mentioned that writing a book is *damn hard work*? ;-) > =20 > Juergen > =20 >=20 > ________________________________ >=20 > Von: spr...@li... im Auftrag = von Ross Mason > Gesendet: Di 16.12.2003 02:23 > An: spr...@li... > Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... >=20 >=20 >=20 > Hi j=FCrgen, >=20 > When I run getBeansOfType() on our config (turning off autowireByType) = I > do get two beans returned: > - I get the emialTemplateManager as expected (this is a proxy > = org.springframework.transaction.interceptor.TransactionProxyFactoryBean).= > - I also get back our emailTemplateManagerTarget which is our proxied > object. >=20 > This suggests you can't use autowireByType when using > TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this > intended behaviour? >=20 > Cheers, >=20 > Ross >=20 >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>Ross, >> >>If you build a single context from multiple files, autowiring will = automatically scan all the bean definitions in those files. In your = case, I assume that you do have multiple definitions of type = EmailTemplateManager, possibly in two different context files. You could = check that programmatically by examining the result of = ApplicationContext.getBeansOfType(EmailTemplateManager.class, true, = true). >> >>In any case, even if you apply autowiring in general, you can always = override a specific dependency, like an explicit bean reference from = property "emailTemplateManager" of bean "notifierCreatePage" to a = specific bean of type EmailTemplateManager: >> >><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >> <property name=3D"emailTemplateManager"><ref = bean=3D"myEmailTemplateManager"/></property> >> ... >></bean> >> >>Juergen >> >> >>________________________________ >> >>Von: spr...@li... im Auftrag = von Ross Mason >>Gesendet: Di 16.12.2003 01:00 >>An: spr...@li... >>Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... >> >> >> >>Hi j=FCrgen, >> >>We were using refresh as we needed to defer the initialisation of the >>String container the first time our app is run until the user has = setup >>their db settings, at which point we initialise the container. After >>that, if/when the server is restarted we use your = ContextLoaderListener >>is used to initialise the container. >> >>I think I've just realised what the problem is. We have 3 >>applicationContexts and the bean causing the error is defined in a >>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 >>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 >>bean 'notifierCreatePage' while setting property 'listeners[0]' on = bean >>'producerCreatePage'; nested exception is: >>org.springframework.beans.factory.UnsatisfiedDependencyException: Bean >>with name 'notifierCreatePage' has an unsatisfied dependency expressed >>through property 'emailTemplateManager': set this property value or >>disable dependency checking for this bean; detail message =3D [There = are 2 >>beans of type [interface >>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>autowire by type. There should have been 1 to be able to autowire >>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>(This is very informative excetion BTW ;-)) >> >>Cheers, >> >>Ross >> >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>Hi Ross, >>> >>>"refresh" is now in ConfigurableApplicationContext, but you shouldn't = need that for typical usages anyway. I guess what you're trying to do is = custom initialization of the root WebApplicationContext, storing it in a = custom place via the setApplicationContext call. That should be fine: I = suppose that the error you're getting has other origins. Autowiring has = been significantly reworked; could you check for which components you = get more than one matching bean? The reason could be that you actually = *have* multiple matching beans, which just weren't found by M2's = autowire implementation, maybe due to being created by FactoryBeans. = Could you quote relevant parts of your configuration? >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag = von Ross Mason >>>Gesendet: Mo 15.12.2003 07:50 >>>An: spr...@li... >>>Betreff: [Springframework-developer] Refreshing the = ApplicationContext... >>> >>> >>> >>>Hi, >>> >>>In the latest source the ApplicationContext.refresh() method has been >>>removed. What is the recommended way of refreshing an >>>applicationContext now. I'm trying - >>> >>> ContextLoader loader =3D new ContextLoader(); >>> setApplicationContext( >>>loader.initWebApplicationContext(servletContext) ); >>> >>>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 = make >>>use of the OpenSessionInViewFilter. >>> >>>Any ideas? >>> >>> >>>Cheers, >>> >>>Ross >>> >>> >>> >>>------------------------------------------------------- >>>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 = admin. >>>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= >>> >>> >>> >>> >>>------------------------------------------------------- >>>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 = admin. >>>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= >>> >> >> >> >> >>------------------------------------------------------- >>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 = admin. >>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> >>------------------------------------------------------- >>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 = admin. >>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 >=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 = admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick > _______________________________________________ > 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 = admin. > 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 ------------------------------------------------------- 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 = admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Ross M. <ro...@at...> - 2003-12-16 22:46:04
|
Hi j=FCrgen, Sounds interesting, anything without EJB is always a bonus in my book -=20 excuse the pun ;-) We've actually decided to wait for the M4 release before migrating. The=20 problem is that we're using a hibernate 2.1 jar built from HEAD and I=20 was getting VerifyErrors errors when running with the latest from Spring=20 HEAD due to an incompatability with the two jars. If you would like me to test it once M4 is using hibernate 2.1 and=20 before you make the actual release I would be happy to. Cheers, Ross j=FCrgen h=F6ller [werk3AT] wrote: > It's "J2EE Development Without EJB", co-authored by Rod and me, the fol= low-up to Rod's "J2EE Design and Development". Editing deadline is mid Ja= nuary, so you can guess that we're quite busy! >=20 > Of course, the book uses Spring for all examples - but it is an archite= cture book, not a Spring tutorial. A dedicated Spring book will follow la= ter next year :-) >=20 > BTW, does the OpenSessionInViewFilter work for you? If there are any is= sues with it, please tell me before the M4 release... >=20 > Finally, is there some documentation on the "external-ref" mechanism th= at you use for XWork/Spring integration? We will probably refer to that i= n Spring docs and the book, so I'd like to make sure that we get the synt= ax right. >=20 > Juergen >=20 >=20 > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Ross Mason > Sent: Tuesday, December 16, 2003 3:39 AM > To: spr...@li... > Subject: Re: [Springframework-developer] Refreshing the > ApplicationContext... >=20 >=20 > Ok mate, sounds like it's time for you to hit the sack. >=20 > BTW What's the book? you can tell me in the morning ;-) >=20 > Cheers, >=20 > Ross >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>I could have thought of that if it wasn't already so late (3:20 in the = morning now). Yes, that's a known limitation: If you proxy an object, bot= h the proxy and the target object will match the type. You need to resort= to explicit references for such beans - as I said, this will even work f= or specific references if you apply autowire-by-type in general. >>=20 >>BTW, have I mentioned that writing a book is *damn hard work*? ;-) >>=20 >>Juergen >>=20 >> >>________________________________ >> >>Von: spr...@li... im Auftrag v= on Ross Mason >>Gesendet: Di 16.12.2003 02:23 >>An: spr...@li... >>Betreff: Re: [Springframework-developer] Refreshing the ApplicationCont= ext... >> >> >> >>Hi j=FCrgen, >> >>When I run getBeansOfType() on our config (turning off autowireByType) = I >>do get two beans returned: >>- I get the emialTemplateManager as expected (this is a proxy >>org.springframework.transaction.interceptor.TransactionProxyFactoryBean= ). >>- I also get back our emailTemplateManagerTarget which is our proxied >>object. >> >>This suggests you can't use autowireByType when using >>TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this >>intended behaviour? >> >>Cheers, >> >>Ross >> >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>Ross, >>> >>>If you build a single context from multiple files, autowiring will aut= omatically scan all the bean definitions in those files. In your case, I = assume that you do have multiple definitions of type EmailTemplateManager= , possibly in two different context files. You could check that programma= tically by examining the result of ApplicationContext.getBeansOfType(Emai= lTemplateManager.class, true, true). >>> >>>In any case, even if you apply autowiring in general, you can always o= verride a specific dependency, like an explicit bean reference from prope= rty "emailTemplateManager" of bean "notifierCreatePage" to a specific bea= n of type EmailTemplateManager: >>> >>><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >>> <property name=3D"emailTemplateManager"><ref bean=3D"myEmailTemplateM= anager"/></property> >>> ... >>></bean> >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag = von Ross Mason >>>Gesendet: Di 16.12.2003 01:00 >>>An: spr...@li... >>>Betreff: Re: [Springframework-developer] Refreshing the ApplicationCon= text... >>> >>> >>> >>>Hi j=FCrgen, >>> >>>We were using refresh as we needed to defer the initialisation of the >>>String container the first time our app is run until the user has setu= p >>>their db settings, at which point we initialise the container. After >>>that, if/when the server is restarted we use your ContextLoaderListene= r >>>is used to initialise the container. >>> >>>I think I've just realised what the problem is. We have 3 >>>applicationContexts and the bean causing the error is defined in a >>>different context. Is there a way to autowire over multiple contexts? >>> >>>If this is the case, the exception for this scenario is a bit misleadi= ng >>>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 >>>bean 'notifierCreatePage' while setting property 'listeners[0]' on bea= n >>>'producerCreatePage'; nested exception is: >>>org.springframework.beans.factory.UnsatisfiedDependencyException: Bean >>>with name 'notifierCreatePage' has an unsatisfied dependency expressed >>>through property 'emailTemplateManager': set this property value or >>>disable dependency checking for this bean; detail message =3D [There a= re 2 >>>beans of type [interface >>>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>>autowire by type. There should have been 1 to be able to autowire >>>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>>(This is very informative excetion BTW ;-)) >>> >>>Cheers, >>> >>>Ross >>> >>> >>>j=FCrgen h=F6ller [werk3AT] wrote: >>> >>> >>> >>> >>>>Hi Ross, >>>> >>>>"refresh" is now in ConfigurableApplicationContext, but you shouldn't= need that for typical usages anyway. I guess what you're trying to do is= custom initialization of the root WebApplicationContext, storing it in a= custom place via the setApplicationContext call. That should be fine: I = suppose that the error you're getting has other origins. Autowiring has b= een significantly reworked; could you check for which components you get = more than one matching bean? The reason could be that you actually *have*= multiple matching beans, which just weren't found by M2's autowire imple= mentation, maybe due to being created by FactoryBeans. Could you quote re= levant parts of your configuration? >>>> >>>>Juergen >>>> >>>> >>>>________________________________ >>>> >>>>Von: spr...@li... im Auftrag= von Ross Mason >>>>Gesendet: Mo 15.12.2003 07:50 >>>>An: spr...@li... >>>>Betreff: [Springframework-developer] Refreshing the ApplicationContex= t... >>>> >>>> >>>> >>>>Hi, >>>> >>>>In the latest source the ApplicationContext.refresh() method has been >>>>removed. What is the recommended way of refreshing an >>>>applicationContext now. I'm trying - >>>> >>>> ContextLoader loader =3D new ContextLoader(); >>>> setApplicationContext( >>>>loader.initWebApplicationContext(servletContext) ); >>>> >>>>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 m= ake >>>>use of the OpenSessionInViewFilter. >>>> >>>>Any ideas? >>>> >>>> >>>>Cheers, >>>> >>>>Ross >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>>Become an expert in LINUX or just sharpen your skills. Sign up for I= BM's >>>>Free Linux Tutorials. Learn everything from the bash shell to sys ad= min. >>>>Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dcli= ck >>>>_______________________________________________ >>>>Springframework-developer mailing list >>>>Spr...@li... >>>>https://lists.sourceforge.net/lists/listinfo/springframework-develope= r >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>>Become an expert in LINUX or just sharpen your skills. Sign up for I= BM's >>>>Free Linux Tutorials. Learn everything from the bash shell to sys ad= min. >>>>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-develope= r >>>> >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>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 >>> >> >> >> >> >>------------------------------------------------------- >>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=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> >>------------------------------------------------------- >>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 >=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=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=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 |
|
From: <jue...@we...> - 2003-12-18 19:31:55
|
Ross, I've just re-tested Petclinic from our current CVS HEAD against a = dropped-in Hibernate 2.1 final (plus cglib2, minus cglib-asm), with and = without OpenSessionInViewFilter. Works nicely for me - no VerifyErrors. = Could you please re-try and re-report if there are still issues? Note that the AOP framework is not migrated to CGLIB2 yet (it's in the = works), but this shouldn't affect you at all if you just proxy via = interfaces (the default). Simply remove cglib-asm from the class path, = drop in hibernate2, cglib2, eh-cache - and you should be done. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Ross Mason Sent: Tuesday, December 16, 2003 11:46 PM To: spr...@li... Subject: Re: [Springframework-developer] Refreshing the ApplicationContext... Hi j=FCrgen, Sounds interesting, anything without EJB is always a bonus in my book -=20 excuse the pun ;-) We've actually decided to wait for the M4 release before migrating. The = problem is that we're using a hibernate 2.1 jar built from HEAD and I=20 was getting VerifyErrors errors when running with the latest from Spring = HEAD due to an incompatability with the two jars. If you would like me to test it once M4 is using hibernate 2.1 and=20 before you make the actual release I would be happy to. Cheers, Ross j=FCrgen h=F6ller [werk3AT] wrote: > It's "J2EE Development Without EJB", co-authored by Rod and me, the = follow-up to Rod's "J2EE Design and Development". Editing deadline is = mid January, so you can guess that we're quite busy! >=20 > Of course, the book uses Spring for all examples - but it is an = architecture book, not a Spring tutorial. A dedicated Spring book will = follow later next year :-) >=20 > BTW, does the OpenSessionInViewFilter work for you? If there are any = issues with it, please tell me before the M4 release... >=20 > Finally, is there some documentation on the "external-ref" mechanism = that you use for XWork/Spring integration? We will probably refer to = that in Spring docs and the book, so I'd like to make sure that we get = the syntax right. >=20 > Juergen >=20 >=20 > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On = Behalf > Of Ross Mason > Sent: Tuesday, December 16, 2003 3:39 AM > To: spr...@li... > Subject: Re: [Springframework-developer] Refreshing the > ApplicationContext... >=20 >=20 > Ok mate, sounds like it's time for you to hit the sack. >=20 > BTW What's the book? you can tell me in the morning ;-) >=20 > Cheers, >=20 > Ross >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>I could have thought of that if it wasn't already so late (3:20 in the = morning now). Yes, that's a known limitation: If you proxy an object, = both the proxy and the target object will match the type. You need to = resort to explicit references for such beans - as I said, this will even = work for specific references if you apply autowire-by-type in general. >>=20 >>BTW, have I mentioned that writing a book is *damn hard work*? ;-) >>=20 >>Juergen >>=20 >> >>________________________________ >> >>Von: spr...@li... im Auftrag = von Ross Mason >>Gesendet: Di 16.12.2003 02:23 >>An: spr...@li... >>Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... >> >> >> >>Hi j=FCrgen, >> >>When I run getBeansOfType() on our config (turning off autowireByType) = I >>do get two beans returned: >>- I get the emialTemplateManager as expected (this is a proxy >>org.springframework.transaction.interceptor.TransactionProxyFactoryBean= ). >>- I also get back our emailTemplateManagerTarget which is our proxied >>object. >> >>This suggests you can't use autowireByType when using >>TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this >>intended behaviour? >> >>Cheers, >> >>Ross >> >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>Ross, >>> >>>If you build a single context from multiple files, autowiring will = automatically scan all the bean definitions in those files. In your = case, I assume that you do have multiple definitions of type = EmailTemplateManager, possibly in two different context files. You could = check that programmatically by examining the result of = ApplicationContext.getBeansOfType(EmailTemplateManager.class, true, = true). >>> >>>In any case, even if you apply autowiring in general, you can always = override a specific dependency, like an explicit bean reference from = property "emailTemplateManager" of bean "notifierCreatePage" to a = specific bean of type EmailTemplateManager: >>> >>><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >>> <property name=3D"emailTemplateManager"><ref = bean=3D"myEmailTemplateManager"/></property> >>> ... >>></bean> >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag = von Ross Mason >>>Gesendet: Di 16.12.2003 01:00 >>>An: spr...@li... >>>Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... >>> >>> >>> >>>Hi j=FCrgen, >>> >>>We were using refresh as we needed to defer the initialisation of the >>>String container the first time our app is run until the user has = setup >>>their db settings, at which point we initialise the container. After >>>that, if/when the server is restarted we use your = ContextLoaderListener >>>is used to initialise the container. >>> >>>I think I've just realised what the problem is. We have 3 >>>applicationContexts and the bean causing the error is defined in a >>>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 >>>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 >>>bean 'notifierCreatePage' while setting property 'listeners[0]' on = bean >>>'producerCreatePage'; nested exception is: >>>org.springframework.beans.factory.UnsatisfiedDependencyException: = Bean >>>with name 'notifierCreatePage' has an unsatisfied dependency = expressed >>>through property 'emailTemplateManager': set this property value or >>>disable dependency checking for this bean; detail message =3D [There = are 2 >>>beans of type [interface >>>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>>autowire by type. There should have been 1 to be able to autowire >>>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>>(This is very informative excetion BTW ;-)) >>> >>>Cheers, >>> >>>Ross >>> >>> >>>j=FCrgen h=F6ller [werk3AT] wrote: >>> >>> >>> >>> >>>>Hi Ross, >>>> >>>>"refresh" is now in ConfigurableApplicationContext, but you = shouldn't need that for typical usages anyway. I guess what you're = trying to do is custom initialization of the root WebApplicationContext, = storing it in a custom place via the setApplicationContext call. That = should be fine: I suppose that the error you're getting has other = origins. Autowiring has been significantly reworked; could you check for = which components you get more than one matching bean? The reason could = be that you actually *have* multiple matching beans, which just weren't = found by M2's autowire implementation, maybe due to being created by = FactoryBeans. Could you quote relevant parts of your configuration? >>>> >>>>Juergen >>>> >>>> >>>>________________________________ >>>> >>>>Von: spr...@li... im = Auftrag von Ross Mason >>>>Gesendet: Mo 15.12.2003 07:50 >>>>An: spr...@li... >>>>Betreff: [Springframework-developer] Refreshing the = ApplicationContext... >>>> >>>> >>>> >>>>Hi, >>>> >>>>In the latest source the ApplicationContext.refresh() method has = been >>>>removed. What is the recommended way of refreshing an >>>>applicationContext now. I'm trying - >>>> >>>> ContextLoader loader =3D new ContextLoader(); >>>> setApplicationContext( >>>>loader.initWebApplicationContext(servletContext) ); >>>> >>>>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 = make >>>>use of the OpenSessionInViewFilter. >>>> >>>>Any ideas? >>>> >>>> >>>>Cheers, >>>> >>>>Ross >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>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 = admin. >>>>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-develope= r >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>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 = admin. >>>>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-develope= r >>>> >>> >>> >>> >>> >>>------------------------------------------------------- >>>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 = admin. >>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer= >>> >>> >>> >>> >>>------------------------------------------------------- >>>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 = admin. >>>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= >>> >> >> >> >> >>------------------------------------------------------- >>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 = admin. >>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> >>------------------------------------------------------- >>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 = admin. >>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 >=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 = admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=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 = admin. > 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 ------------------------------------------------------- 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 = admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Ross M. <ro...@at...> - 2003-12-18 22:26:42
|
Ok mate, I'll get on the case today Ross j=FCrgen h=F6ller [werk3AT] wrote: > Ross, >=20 > I've just re-tested Petclinic from our current CVS HEAD against a dropp= ed-in Hibernate 2.1 final (plus cglib2, minus cglib-asm), with and withou= t OpenSessionInViewFilter. Works nicely for me - no VerifyErrors. Could y= ou please re-try and re-report if there are still issues? >=20 > Note that the AOP framework is not migrated to CGLIB2 yet (it's in the = works), but this shouldn't affect you at all if you just proxy via interf= aces (the default). Simply remove cglib-asm from the class path, drop in = hibernate2, cglib2, eh-cache - and you should be done. >=20 > Juergen >=20 >=20 > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Ross Mason > Sent: Tuesday, December 16, 2003 11:46 PM > To: spr...@li... > Subject: Re: [Springframework-developer] Refreshing the > ApplicationContext... >=20 >=20 > Hi j=FCrgen, >=20 > Sounds interesting, anything without EJB is always a bonus in my book -= =20 > excuse the pun ;-) >=20 > We've actually decided to wait for the M4 release before migrating. Th= e=20 > problem is that we're using a hibernate 2.1 jar built from HEAD and I=20 > was getting VerifyErrors errors when running with the latest from Sprin= g=20 > HEAD due to an incompatability with the two jars. >=20 > If you would like me to test it once M4 is using hibernate 2.1 and=20 > before you make the actual release I would be happy to. >=20 > Cheers, >=20 > Ross >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>It's "J2EE Development Without EJB", co-authored by Rod and me, the fol= low-up to Rod's "J2EE Design and Development". Editing deadline is mid Ja= nuary, so you can guess that we're quite busy! >> >>Of course, the book uses Spring for all examples - but it is an archite= cture book, not a Spring tutorial. A dedicated Spring book will follow la= ter next year :-) >> >>BTW, does the OpenSessionInViewFilter work for you? If there are any is= sues with it, please tell me before the M4 release... >> >>Finally, is there some documentation on the "external-ref" mechanism th= at you use for XWork/Spring integration? We will probably refer to that i= n Spring docs and the book, so I'd like to make sure that we get the synt= ax right. >> >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...]On Behalf >>Of Ross Mason >>Sent: Tuesday, December 16, 2003 3:39 AM >>To: spr...@li... >>Subject: Re: [Springframework-developer] Refreshing the >>ApplicationContext... >> >> >>Ok mate, sounds like it's time for you to hit the sack. >> >>BTW What's the book? you can tell me in the morning ;-) >> >>Cheers, >> >>Ross >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>I could have thought of that if it wasn't already so late (3:20 in the= morning now). Yes, that's a known limitation: If you proxy an object, bo= th the proxy and the target object will match the type. You need to resor= t to explicit references for such beans - as I said, this will even work = for specific references if you apply autowire-by-type in general. >>> >>>BTW, have I mentioned that writing a book is *damn hard work*? ;-) >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag = von Ross Mason >>>Gesendet: Di 16.12.2003 02:23 >>>An: spr...@li... >>>Betreff: Re: [Springframework-developer] Refreshing the ApplicationCon= text... >>> >>> >>> >>>Hi j=FCrgen, >>> >>>When I run getBeansOfType() on our config (turning off autowireByType)= I >>>do get two beans returned: >>>- I get the emialTemplateManager as expected (this is a proxy >>>org.springframework.transaction.interceptor.TransactionProxyFactoryBea= n). >>>- I also get back our emailTemplateManagerTarget which is our proxied >>>object. >>> >>>This suggests you can't use autowireByType when using >>>TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this >>>intended behaviour? >>> >>>Cheers, >>> >>>Ross >>> >>> >>>j=FCrgen h=F6ller [werk3AT] wrote: >>> >>> >>> >>> >>>>Ross, >>>> >>>>If you build a single context from multiple files, autowiring will au= tomatically scan all the bean definitions in those files. In your case, I= assume that you do have multiple definitions of type EmailTemplateManage= r, possibly in two different context files. You could check that programm= atically by examining the result of ApplicationContext.getBeansOfType(Ema= ilTemplateManager.class, true, true). >>>> >>>>In any case, even if you apply autowiring in general, you can always = override a specific dependency, like an explicit bean reference from prop= erty "emailTemplateManager" of bean "notifierCreatePage" to a specific be= an of type EmailTemplateManager: >>>> >>>><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >>>><property name=3D"emailTemplateManager"><ref bean=3D"myEmailTemplateM= anager"/></property> >>>>... >>>></bean> >>>> >>>>Juergen >>>> >>>> >>>>________________________________ >>>> >>>>Von: spr...@li... im Auftrag= von Ross Mason >>>>Gesendet: Di 16.12.2003 01:00 >>>>An: spr...@li... >>>>Betreff: Re: [Springframework-developer] Refreshing the ApplicationCo= ntext... >>>> >>>> >>>> >>>>Hi j=FCrgen, >>>> >>>>We were using refresh as we needed to defer the initialisation of the >>>>String container the first time our app is run until the user has set= up >>>>their db settings, at which point we initialise the container. After >>>>that, if/when the server is restarted we use your ContextLoaderListen= er >>>>is used to initialise the container. >>>> >>>>I think I've just realised what the problem is. We have 3 >>>>applicationContexts and the bean causing the error is defined in a >>>>different context. Is there a way to autowire over multiple contexts= ? >>>> >>>>If this is the case, the exception for this scenario is a bit mislead= ing >>>>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 >>>>bean 'notifierCreatePage' while setting property 'listeners[0]' on be= an >>>>'producerCreatePage'; nested exception is: >>>>org.springframework.beans.factory.UnsatisfiedDependencyException: Bea= n >>>>with name 'notifierCreatePage' has an unsatisfied dependency expresse= d >>>>through property 'emailTemplateManager': set this property value or >>>>disable dependency checking for this bean; detail message =3D [There = are 2 >>>>beans of type [interface >>>>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>>>autowire by type. There should have been 1 to be able to autowire >>>>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>>>(This is very informative excetion BTW ;-)) >>>> >>>>Cheers, >>>> >>>>Ross >>>> >>>> >>>>j=FCrgen h=F6ller [werk3AT] wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Hi Ross, >>>>> >>>>>"refresh" is now in ConfigurableApplicationContext, but you shouldn'= t need that for typical usages anyway. I guess what you're trying to do i= s custom initialization of the root WebApplicationContext, storing it in = a custom place via the setApplicationContext call. That should be fine: I= suppose that the error you're getting has other origins. Autowiring has = been significantly reworked; could you check for which components you get= more than one matching bean? The reason could be that you actually *have= * multiple matching beans, which just weren't found by M2's autowire impl= ementation, maybe due to being created by FactoryBeans. Could you quote r= elevant parts of your configuration? >>>>> >>>>>Juergen >>>>> >>>>> >>>>>________________________________ >>>>> >>>>>Von: spr...@li... im Auftra= g von Ross Mason >>>>>Gesendet: Mo 15.12.2003 07:50 >>>>>An: spr...@li... >>>>>Betreff: [Springframework-developer] Refreshing the ApplicationConte= xt... >>>>> >>>>> >>>>> >>>>>Hi, >>>>> >>>>>In the latest source the ApplicationContext.refresh() method has bee= n >>>>>removed. What is the recommended way of refreshing an >>>>>applicationContext now. I'm trying - >>>>> >>>>> ContextLoader loader =3D new ContextLoader(); >>>>> setApplicationContext( >>>>>loader.initWebApplicationContext(servletContext) ); >>>>> >>>>>But I am getting an error saying that there is more than one matchin= g >>>>>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 = make >>>>>use of the OpenSessionInViewFilter. >>>>> >>>>>Any ideas? >>>>> >>>>> >>>>>Cheers, >>>>> >>>>>Ross >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 a= dmin. >>>>>Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dcl= ick >>>>>_______________________________________________ >>>>>Springframework-developer mailing list >>>>>Spr...@li... >>>>>https://lists.sourceforge.net/lists/listinfo/springframework-develop= er >>>>> >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 a= dmin. >>>>>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-develop= er >>>>> >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>>Become an expert in LINUX or just sharpen your skills. Sign up for I= BM's >>>>Free Linux Tutorials. Learn everything from the bash shell to sys ad= min. >>>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>>_______________________________________________ >>>>Springframework-developer mailing list >>>>Spr...@li... >>>>https://lists.sourceforge.net/lists/listinfo/springframework-develope= r >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>>Become an expert in LINUX or just sharpen your skills. Sign up for I= BM's >>>>Free Linux Tutorials. Learn everything from the bash shell to sys ad= min. >>>>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-develope= r >>>> >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>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 >>> >> >> >> >> >>------------------------------------------------------- >>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=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >>------------------------------------------------------- >>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 >=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=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=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 |
|
From: Ross M. <ro...@at...> - 2003-12-19 08:22:49
|
Hi J=FCrgen, Just to let you know I didn't have time today to try out the=20 OpenSessionInViewFilter, we've been busy doing a release of Confluence=20 beta1. I'll try it out on Monday now. I remember last week there were some postings about removing/changing=20 the Spring Wiki, so you might be interested in checking out=20 http://confluence.atlassian.com. And of course it's using Spring ;-) Have a good weekend, Ross j=FCrgen h=F6ller [werk3AT] wrote: > Ross, >=20 > I've just re-tested Petclinic from our current CVS HEAD against a dropp= ed-in Hibernate 2.1 final (plus cglib2, minus cglib-asm), with and withou= t OpenSessionInViewFilter. Works nicely for me - no VerifyErrors. Could y= ou please re-try and re-report if there are still issues? >=20 > Note that the AOP framework is not migrated to CGLIB2 yet (it's in the = works), but this shouldn't affect you at all if you just proxy via interf= aces (the default). Simply remove cglib-asm from the class path, drop in = hibernate2, cglib2, eh-cache - and you should be done. >=20 > Juergen >=20 >=20 > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Ross Mason > Sent: Tuesday, December 16, 2003 11:46 PM > To: spr...@li... > Subject: Re: [Springframework-developer] Refreshing the > ApplicationContext... >=20 >=20 > Hi j=FCrgen, >=20 > Sounds interesting, anything without EJB is always a bonus in my book -= =20 > excuse the pun ;-) >=20 > We've actually decided to wait for the M4 release before migrating. Th= e=20 > problem is that we're using a hibernate 2.1 jar built from HEAD and I=20 > was getting VerifyErrors errors when running with the latest from Sprin= g=20 > HEAD due to an incompatability with the two jars. >=20 > If you would like me to test it once M4 is using hibernate 2.1 and=20 > before you make the actual release I would be happy to. >=20 > Cheers, >=20 > Ross >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>It's "J2EE Development Without EJB", co-authored by Rod and me, the fol= low-up to Rod's "J2EE Design and Development". Editing deadline is mid Ja= nuary, so you can guess that we're quite busy! >> >>Of course, the book uses Spring for all examples - but it is an archite= cture book, not a Spring tutorial. A dedicated Spring book will follow la= ter next year :-) >> >>BTW, does the OpenSessionInViewFilter work for you? If there are any is= sues with it, please tell me before the M4 release... >> >>Finally, is there some documentation on the "external-ref" mechanism th= at you use for XWork/Spring integration? We will probably refer to that i= n Spring docs and the book, so I'd like to make sure that we get the synt= ax right. >> >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...]On Behalf >>Of Ross Mason >>Sent: Tuesday, December 16, 2003 3:39 AM >>To: spr...@li... >>Subject: Re: [Springframework-developer] Refreshing the >>ApplicationContext... >> >> >>Ok mate, sounds like it's time for you to hit the sack. >> >>BTW What's the book? you can tell me in the morning ;-) >> >>Cheers, >> >>Ross >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>I could have thought of that if it wasn't already so late (3:20 in the= morning now). Yes, that's a known limitation: If you proxy an object, bo= th the proxy and the target object will match the type. You need to resor= t to explicit references for such beans - as I said, this will even work = for specific references if you apply autowire-by-type in general. >>> >>>BTW, have I mentioned that writing a book is *damn hard work*? ;-) >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag = von Ross Mason >>>Gesendet: Di 16.12.2003 02:23 >>>An: spr...@li... >>>Betreff: Re: [Springframework-developer] Refreshing the ApplicationCon= text... >>> >>> >>> >>>Hi j=FCrgen, >>> >>>When I run getBeansOfType() on our config (turning off autowireByType)= I >>>do get two beans returned: >>>- I get the emialTemplateManager as expected (this is a proxy >>>org.springframework.transaction.interceptor.TransactionProxyFactoryBea= n). >>>- I also get back our emailTemplateManagerTarget which is our proxied >>>object. >>> >>>This suggests you can't use autowireByType when using >>>TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this >>>intended behaviour? >>> >>>Cheers, >>> >>>Ross >>> >>> >>>j=FCrgen h=F6ller [werk3AT] wrote: >>> >>> >>> >>> >>>>Ross, >>>> >>>>If you build a single context from multiple files, autowiring will au= tomatically scan all the bean definitions in those files. In your case, I= assume that you do have multiple definitions of type EmailTemplateManage= r, possibly in two different context files. You could check that programm= atically by examining the result of ApplicationContext.getBeansOfType(Ema= ilTemplateManager.class, true, true). >>>> >>>>In any case, even if you apply autowiring in general, you can always = override a specific dependency, like an explicit bean reference from prop= erty "emailTemplateManager" of bean "notifierCreatePage" to a specific be= an of type EmailTemplateManager: >>>> >>>><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >>>><property name=3D"emailTemplateManager"><ref bean=3D"myEmailTemplateM= anager"/></property> >>>>... >>>></bean> >>>> >>>>Juergen >>>> >>>> >>>>________________________________ >>>> >>>>Von: spr...@li... im Auftrag= von Ross Mason >>>>Gesendet: Di 16.12.2003 01:00 >>>>An: spr...@li... >>>>Betreff: Re: [Springframework-developer] Refreshing the ApplicationCo= ntext... >>>> >>>> >>>> >>>>Hi j=FCrgen, >>>> >>>>We were using refresh as we needed to defer the initialisation of the >>>>String container the first time our app is run until the user has set= up >>>>their db settings, at which point we initialise the container. After >>>>that, if/when the server is restarted we use your ContextLoaderListen= er >>>>is used to initialise the container. >>>> >>>>I think I've just realised what the problem is. We have 3 >>>>applicationContexts and the bean causing the error is defined in a >>>>different context. Is there a way to autowire over multiple contexts= ? >>>> >>>>If this is the case, the exception for this scenario is a bit mislead= ing >>>>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 >>>>bean 'notifierCreatePage' while setting property 'listeners[0]' on be= an >>>>'producerCreatePage'; nested exception is: >>>>org.springframework.beans.factory.UnsatisfiedDependencyException: Bea= n >>>>with name 'notifierCreatePage' has an unsatisfied dependency expresse= d >>>>through property 'emailTemplateManager': set this property value or >>>>disable dependency checking for this bean; detail message =3D [There = are 2 >>>>beans of type [interface >>>>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>>>autowire by type. There should have been 1 to be able to autowire >>>>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>>>(This is very informative excetion BTW ;-)) >>>> >>>>Cheers, >>>> >>>>Ross >>>> >>>> >>>>j=FCrgen h=F6ller [werk3AT] wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Hi Ross, >>>>> >>>>>"refresh" is now in ConfigurableApplicationContext, but you shouldn'= t need that for typical usages anyway. I guess what you're trying to do i= s custom initialization of the root WebApplicationContext, storing it in = a custom place via the setApplicationContext call. That should be fine: I= suppose that the error you're getting has other origins. Autowiring has = been significantly reworked; could you check for which components you get= more than one matching bean? The reason could be that you actually *have= * multiple matching beans, which just weren't found by M2's autowire impl= ementation, maybe due to being created by FactoryBeans. Could you quote r= elevant parts of your configuration? >>>>> >>>>>Juergen >>>>> >>>>> >>>>>________________________________ >>>>> >>>>>Von: spr...@li... im Auftra= g von Ross Mason >>>>>Gesendet: Mo 15.12.2003 07:50 >>>>>An: spr...@li... >>>>>Betreff: [Springframework-developer] Refreshing the ApplicationConte= xt... >>>>> >>>>> >>>>> >>>>>Hi, >>>>> >>>>>In the latest source the ApplicationContext.refresh() method has bee= n >>>>>removed. What is the recommended way of refreshing an >>>>>applicationContext now. I'm trying - >>>>> >>>>> ContextLoader loader =3D new ContextLoader(); >>>>> setApplicationContext( >>>>>loader.initWebApplicationContext(servletContext) ); >>>>> >>>>>But I am getting an error saying that there is more than one matchin= g >>>>>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 = make >>>>>use of the OpenSessionInViewFilter. >>>>> >>>>>Any ideas? >>>>> >>>>> >>>>>Cheers, >>>>> >>>>>Ross >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 a= dmin. >>>>>Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dcl= ick >>>>>_______________________________________________ >>>>>Springframework-developer mailing list >>>>>Spr...@li... >>>>>https://lists.sourceforge.net/lists/listinfo/springframework-develop= er >>>>> >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 a= dmin. >>>>>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-develop= er >>>>> >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>>Become an expert in LINUX or just sharpen your skills. Sign up for I= BM's >>>>Free Linux Tutorials. Learn everything from the bash shell to sys ad= min. >>>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>>_______________________________________________ >>>>Springframework-developer mailing list >>>>Spr...@li... >>>>https://lists.sourceforge.net/lists/listinfo/springframework-develope= r >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>>Become an expert in LINUX or just sharpen your skills. Sign up for I= BM's >>>>Free Linux Tutorials. Learn everything from the bash shell to sys ad= min. >>>>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-develope= r >>>> >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>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 >>> >> >> >> >> >>------------------------------------------------------- >>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=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >>------------------------------------------------------- >>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 >=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=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=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 |
|
From: <jue...@we...> - 2003-12-19 08:47:23
|
Ross, =20 Never mind, I understand that a beta of Confluence has priority. It = would be good to sort any issues out before Christmas though, so I would = be happy to come back to this on Monday if possible. If there aren't any = obstacles, I will release 1.0 M4 a couple of hours before Christmas... =20 It is indeed tempting to use Confluence as Spring Wiki - what do others = think? BTW, it's really good to see that such a major, publically = visible product is based on Spring! Now you just need to base the next = major release of JIRA on Spring, then I'm perfectly happy ;-) =20 Have a good weekend too! =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Ross Mason Gesendet: Fr 19.12.2003 09:23 An: spr...@li... Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... Hi J=FCrgen, Just to let you know I didn't have time today to try out the OpenSessionInViewFilter, we've been busy doing a release of Confluence beta1. I'll try it out on Monday now. I remember last week there were some postings about removing/changing the Spring Wiki, so you might be interested in checking out http://confluence.atlassian.com. And of course it's using Spring ;-) Have a good weekend, Ross j=FCrgen h=F6ller [werk3AT] wrote: > Ross, > > I've just re-tested Petclinic from our current CVS HEAD against a = dropped-in Hibernate 2.1 final (plus cglib2, minus cglib-asm), with and = without OpenSessionInViewFilter. Works nicely for me - no VerifyErrors. = Could you please re-try and re-report if there are still issues? > > Note that the AOP framework is not migrated to CGLIB2 yet (it's in the = works), but this shouldn't affect you at all if you just proxy via = interfaces (the default). Simply remove cglib-asm from the class path, = drop in hibernate2, cglib2, eh-cache - and you should be done. > > Juergen > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On = Behalf > Of Ross Mason > Sent: Tuesday, December 16, 2003 11:46 PM > To: spr...@li... > Subject: Re: [Springframework-developer] Refreshing the > ApplicationContext... > > > Hi j=FCrgen, > > Sounds interesting, anything without EJB is always a bonus in my book = - > excuse the pun ;-) > > We've actually decided to wait for the M4 release before migrating. = The > problem is that we're using a hibernate 2.1 jar built from HEAD and I > was getting VerifyErrors errors when running with the latest from = Spring > HEAD due to an incompatability with the two jars. > > If you would like me to test it once M4 is using hibernate 2.1 and > before you make the actual release I would be happy to. > > Cheers, > > Ross > > j=FCrgen h=F6ller [werk3AT] wrote: > > >>It's "J2EE Development Without EJB", co-authored by Rod and me, the = follow-up to Rod's "J2EE Design and Development". Editing deadline is = mid January, so you can guess that we're quite busy! >> >>Of course, the book uses Spring for all examples - but it is an = architecture book, not a Spring tutorial. A dedicated Spring book will = follow later next year :-) >> >>BTW, does the OpenSessionInViewFilter work for you? If there are any = issues with it, please tell me before the M4 release... >> >>Finally, is there some documentation on the "external-ref" mechanism = that you use for XWork/Spring integration? We will probably refer to = that in Spring docs and the book, so I'd like to make sure that we get = the syntax right. >> >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...]On = Behalf >>Of Ross Mason >>Sent: Tuesday, December 16, 2003 3:39 AM >>To: spr...@li... >>Subject: Re: [Springframework-developer] Refreshing the >>ApplicationContext... >> >> >>Ok mate, sounds like it's time for you to hit the sack. >> >>BTW What's the book? you can tell me in the morning ;-) >> >>Cheers, >> >>Ross >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>I could have thought of that if it wasn't already so late (3:20 in = the morning now). Yes, that's a known limitation: If you proxy an = object, both the proxy and the target object will match the type. You = need to resort to explicit references for such beans - as I said, this = will even work for specific references if you apply autowire-by-type in = general. >>> >>>BTW, have I mentioned that writing a book is *damn hard work*? ;-) >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag = von Ross Mason >>>Gesendet: Di 16.12.2003 02:23 >>>An: spr...@li... >>>Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... >>> >>> >>> >>>Hi j=FCrgen, >>> >>>When I run getBeansOfType() on our config (turning off = autowireByType) I >>>do get two beans returned: >>>- I get the emialTemplateManager as expected (this is a proxy >>>org.springframework.transaction.interceptor.TransactionProxyFactoryBea= n). >>>- I also get back our emailTemplateManagerTarget which is our proxied >>>object. >>> >>>This suggests you can't use autowireByType when using >>>TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this >>>intended behaviour? >>> >>>Cheers, >>> >>>Ross >>> >>> >>>j=FCrgen h=F6ller [werk3AT] wrote: >>> >>> >>> >>> >>>>Ross, >>>> >>>>If you build a single context from multiple files, autowiring will = automatically scan all the bean definitions in those files. In your = case, I assume that you do have multiple definitions of type = EmailTemplateManager, possibly in two different context files. You could = check that programmatically by examining the result of = ApplicationContext.getBeansOfType(EmailTemplateManager.class, true, = true). >>>> >>>>In any case, even if you apply autowiring in general, you can always = override a specific dependency, like an explicit bean reference from = property "emailTemplateManager" of bean "notifierCreatePage" to a = specific bean of type EmailTemplateManager: >>>> >>>><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >>>><property name=3D"emailTemplateManager"><ref = bean=3D"myEmailTemplateManager"/></property> >>>>... >>>></bean> >>>> >>>>Juergen >>>> >>>> >>>>________________________________ >>>> >>>>Von: spr...@li... im = Auftrag von Ross Mason >>>>Gesendet: Di 16.12.2003 01:00 >>>>An: spr...@li... >>>>Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... >>>> >>>> >>>> >>>>Hi j=FCrgen, >>>> >>>>We were using refresh as we needed to defer the initialisation of = the >>>>String container the first time our app is run until the user has = setup >>>>their db settings, at which point we initialise the container. = After >>>>that, if/when the server is restarted we use your = ContextLoaderListener >>>>is used to initialise the container. >>>> >>>>I think I've just realised what the problem is. We have 3 >>>>applicationContexts and the bean causing the error is defined in a >>>>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 >>>>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 >>>>bean 'notifierCreatePage' while setting property 'listeners[0]' on = bean >>>>'producerCreatePage'; nested exception is: >>>>org.springframework.beans.factory.UnsatisfiedDependencyException: = Bean >>>>with name 'notifierCreatePage' has an unsatisfied dependency = expressed >>>>through property 'emailTemplateManager': set this property value or >>>>disable dependency checking for this bean; detail message =3D [There = are 2 >>>>beans of type [interface >>>>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>>>autowire by type. There should have been 1 to be able to autowire >>>>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>>>(This is very informative excetion BTW ;-)) >>>> >>>>Cheers, >>>> >>>>Ross >>>> >>>> >>>>j=FCrgen h=F6ller [werk3AT] wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Hi Ross, >>>>> >>>>>"refresh" is now in ConfigurableApplicationContext, but you = shouldn't need that for typical usages anyway. I guess what you're = trying to do is custom initialization of the root WebApplicationContext, = storing it in a custom place via the setApplicationContext call. That = should be fine: I suppose that the error you're getting has other = origins. Autowiring has been significantly reworked; could you check for = which components you get more than one matching bean? The reason could = be that you actually *have* multiple matching beans, which just weren't = found by M2's autowire implementation, maybe due to being created by = FactoryBeans. Could you quote relevant parts of your configuration? >>>>> >>>>>Juergen >>>>> >>>>> >>>>>________________________________ >>>>> >>>>>Von: spr...@li... im = Auftrag von Ross Mason >>>>>Gesendet: Mo 15.12.2003 07:50 >>>>>An: spr...@li... >>>>>Betreff: [Springframework-developer] Refreshing the = ApplicationContext... >>>>> >>>>> >>>>> >>>>>Hi, >>>>> >>>>>In the latest source the ApplicationContext.refresh() method has = been >>>>>removed. What is the recommended way of refreshing an >>>>>applicationContext now. I'm trying - >>>>> >>>>> ContextLoader loader =3D new ContextLoader(); >>>>> setApplicationContext( >>>>>loader.initWebApplicationContext(servletContext) ); >>>>> >>>>>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 = make >>>>>use of the OpenSessionInViewFilter. >>>>> >>>>>Any ideas? >>>>> >>>>> >>>>>Cheers, >>>>> >>>>>Ross >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 = admin. >>>>>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-develop= er >>>>> >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 = admin. >>>>>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-develop= er >>>>> >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>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 = admin. >>>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>>_______________________________________________ >>>>Springframework-developer mailing list >>>>Spr...@li... >>>>https://lists.sourceforge.net/lists/listinfo/springframework-develope= r >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>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 = admin. >>>>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-develope= r >>>> >>> >>> >>> >>> >>>------------------------------------------------------- >>>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 = admin. >>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer= >>> >>> >>> >>> >>>------------------------------------------------------- >>>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 = admin. >>>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= >>> >> >> >> >> >>------------------------------------------------------- >>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 = admin. >>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >>------------------------------------------------------- >>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 = admin. >>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 >> > > > > > ------------------------------------------------------- > 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 = admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > ------------------------------------------------------- > 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 = admin. > 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 > ------------------------------------------------------- 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 = admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Rod J. <rod...@in...> - 2003-12-19 09:25:35
|
>It is indeed tempting to use Confluence as Spring Wiki - what do others think? BTW, it's really good to see that such a major, publically visible product is based on Spring! Now you just need to base the next major release of JIRA on Spring, then I'm perfectly happy ;-) I think this is a great idea. And congratulations on getting your beta out. Regards, Rod |
|
From: Colin S. <col...@ex...> - 2003-12-19 12:16:52
|
jürgen höller [werk3AT] wrote: >Ross, > >Never mind, I understand that a beta of Confluence has priority. It would be good to sort any issues out before Christmas though, so I would be happy to come back to this on Monday if possible. If there aren't any obstacles, I will release 1.0 M4 a couple of hours before Christmas... > >It is indeed tempting to use Confluence as Spring Wiki - what do others think? BTW, it's really good to see that such a major, publically visible product is based on Spring! Now you just need to base the next major release of JIRA on Spring, then I'm perfectly happy ;-) > > +1 |
|
From: Dmitriy K. <dko...@ru...> - 2003-12-19 11:59:08
|
Confluence looks good. Congratulation Atlassian! So, what architecture do you have for this one? WW2(MVC) + Spring(IoC) + Hibernate(O/R)? Do you use any features of SpringAOP module? Regards, Dmitriy. ----- Original Message ----- From: Rod Johnson <rod...@in...> Date: Friday, December 19, 2003 4:25 am Subject: Re: [Springframework-developer] Refreshing the ApplicationContext... > >It is indeed tempting to use Confluence as Spring Wiki - what do > othersthink? BTW, it's really good to see that such a major, > publically visible > product is based on Spring! Now you just need to base the next > major release > of JIRA on Spring, then I'm perfectly happy ;-) > > I think this is a great idea. And congratulations on getting your > beta out. > > Regards, > Rod > > > > > ------------------------------------------------------- > 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 > admin.Click now! > http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click_______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: <jue...@we...> - 2003-12-19 17:47:29
|
FYI, we've migrated our AOP framework to CGLIB2 today, also shipping = Hibernate 2.1.1 now and building Spring against it. This will be the = basis for 1.0 M4, to be released mid next week. So there shouldn't be = any potential for Hibernate 2.1/CGLIB2 issues anymore! Finally, congratulations on your beta, of course! Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Ross Mason Sent: Friday, December 19, 2003 9:23 AM To: spr...@li... Subject: Re: [Springframework-developer] Refreshing the ApplicationContext... Hi J=FCrgen, Just to let you know I didn't have time today to try out the=20 OpenSessionInViewFilter, we've been busy doing a release of Confluence=20 beta1. I'll try it out on Monday now. I remember last week there were some postings about removing/changing=20 the Spring Wiki, so you might be interested in checking out=20 http://confluence.atlassian.com. And of course it's using Spring ;-) Have a good weekend, Ross j=FCrgen h=F6ller [werk3AT] wrote: > Ross, >=20 > I've just re-tested Petclinic from our current CVS HEAD against a = dropped-in Hibernate 2.1 final (plus cglib2, minus cglib-asm), with and = without OpenSessionInViewFilter. Works nicely for me - no VerifyErrors. = Could you please re-try and re-report if there are still issues? >=20 > Note that the AOP framework is not migrated to CGLIB2 yet (it's in the = works), but this shouldn't affect you at all if you just proxy via = interfaces (the default). Simply remove cglib-asm from the class path, = drop in hibernate2, cglib2, eh-cache - and you should be done. >=20 > Juergen >=20 >=20 > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On = Behalf > Of Ross Mason > Sent: Tuesday, December 16, 2003 11:46 PM > To: spr...@li... > Subject: Re: [Springframework-developer] Refreshing the > ApplicationContext... >=20 >=20 > Hi j=FCrgen, >=20 > Sounds interesting, anything without EJB is always a bonus in my book = -=20 > excuse the pun ;-) >=20 > We've actually decided to wait for the M4 release before migrating. = The=20 > problem is that we're using a hibernate 2.1 jar built from HEAD and I=20 > was getting VerifyErrors errors when running with the latest from = Spring=20 > HEAD due to an incompatability with the two jars. >=20 > If you would like me to test it once M4 is using hibernate 2.1 and=20 > before you make the actual release I would be happy to. >=20 > Cheers, >=20 > Ross >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>It's "J2EE Development Without EJB", co-authored by Rod and me, the = follow-up to Rod's "J2EE Design and Development". Editing deadline is = mid January, so you can guess that we're quite busy! >> >>Of course, the book uses Spring for all examples - but it is an = architecture book, not a Spring tutorial. A dedicated Spring book will = follow later next year :-) >> >>BTW, does the OpenSessionInViewFilter work for you? If there are any = issues with it, please tell me before the M4 release... >> >>Finally, is there some documentation on the "external-ref" mechanism = that you use for XWork/Spring integration? We will probably refer to = that in Spring docs and the book, so I'd like to make sure that we get = the syntax right. >> >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...]On = Behalf >>Of Ross Mason >>Sent: Tuesday, December 16, 2003 3:39 AM >>To: spr...@li... >>Subject: Re: [Springframework-developer] Refreshing the >>ApplicationContext... >> >> >>Ok mate, sounds like it's time for you to hit the sack. >> >>BTW What's the book? you can tell me in the morning ;-) >> >>Cheers, >> >>Ross >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>I could have thought of that if it wasn't already so late (3:20 in = the morning now). Yes, that's a known limitation: If you proxy an = object, both the proxy and the target object will match the type. You = need to resort to explicit references for such beans - as I said, this = will even work for specific references if you apply autowire-by-type in = general. >>> >>>BTW, have I mentioned that writing a book is *damn hard work*? ;-) >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag = von Ross Mason >>>Gesendet: Di 16.12.2003 02:23 >>>An: spr...@li... >>>Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... >>> >>> >>> >>>Hi j=FCrgen, >>> >>>When I run getBeansOfType() on our config (turning off = autowireByType) I >>>do get two beans returned: >>>- I get the emialTemplateManager as expected (this is a proxy >>>org.springframework.transaction.interceptor.TransactionProxyFactoryBea= n). >>>- I also get back our emailTemplateManagerTarget which is our proxied >>>object. >>> >>>This suggests you can't use autowireByType when using >>>TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this >>>intended behaviour? >>> >>>Cheers, >>> >>>Ross >>> >>> >>>j=FCrgen h=F6ller [werk3AT] wrote: >>> >>> >>> >>> >>>>Ross, >>>> >>>>If you build a single context from multiple files, autowiring will = automatically scan all the bean definitions in those files. In your = case, I assume that you do have multiple definitions of type = EmailTemplateManager, possibly in two different context files. You could = check that programmatically by examining the result of = ApplicationContext.getBeansOfType(EmailTemplateManager.class, true, = true). >>>> >>>>In any case, even if you apply autowiring in general, you can always = override a specific dependency, like an explicit bean reference from = property "emailTemplateManager" of bean "notifierCreatePage" to a = specific bean of type EmailTemplateManager: >>>> >>>><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >>>><property name=3D"emailTemplateManager"><ref = bean=3D"myEmailTemplateManager"/></property> >>>>... >>>></bean> >>>> >>>>Juergen >>>> >>>> >>>>________________________________ >>>> >>>>Von: spr...@li... im = Auftrag von Ross Mason >>>>Gesendet: Di 16.12.2003 01:00 >>>>An: spr...@li... >>>>Betreff: Re: [Springframework-developer] Refreshing the = ApplicationContext... >>>> >>>> >>>> >>>>Hi j=FCrgen, >>>> >>>>We were using refresh as we needed to defer the initialisation of = the >>>>String container the first time our app is run until the user has = setup >>>>their db settings, at which point we initialise the container. = After >>>>that, if/when the server is restarted we use your = ContextLoaderListener >>>>is used to initialise the container. >>>> >>>>I think I've just realised what the problem is. We have 3 >>>>applicationContexts and the bean causing the error is defined in a >>>>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 >>>>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 >>>>bean 'notifierCreatePage' while setting property 'listeners[0]' on = bean >>>>'producerCreatePage'; nested exception is: >>>>org.springframework.beans.factory.UnsatisfiedDependencyException: = Bean >>>>with name 'notifierCreatePage' has an unsatisfied dependency = expressed >>>>through property 'emailTemplateManager': set this property value or >>>>disable dependency checking for this bean; detail message =3D [There = are 2 >>>>beans of type [interface >>>>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>>>autowire by type. There should have been 1 to be able to autowire >>>>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>>>(This is very informative excetion BTW ;-)) >>>> >>>>Cheers, >>>> >>>>Ross >>>> >>>> >>>>j=FCrgen h=F6ller [werk3AT] wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Hi Ross, >>>>> >>>>>"refresh" is now in ConfigurableApplicationContext, but you = shouldn't need that for typical usages anyway. I guess what you're = trying to do is custom initialization of the root WebApplicationContext, = storing it in a custom place via the setApplicationContext call. That = should be fine: I suppose that the error you're getting has other = origins. Autowiring has been significantly reworked; could you check for = which components you get more than one matching bean? The reason could = be that you actually *have* multiple matching beans, which just weren't = found by M2's autowire implementation, maybe due to being created by = FactoryBeans. Could you quote relevant parts of your configuration? >>>>> >>>>>Juergen >>>>> >>>>> >>>>>________________________________ >>>>> >>>>>Von: spr...@li... im = Auftrag von Ross Mason >>>>>Gesendet: Mo 15.12.2003 07:50 >>>>>An: spr...@li... >>>>>Betreff: [Springframework-developer] Refreshing the = ApplicationContext... >>>>> >>>>> >>>>> >>>>>Hi, >>>>> >>>>>In the latest source the ApplicationContext.refresh() method has = been >>>>>removed. What is the recommended way of refreshing an >>>>>applicationContext now. I'm trying - >>>>> >>>>> ContextLoader loader =3D new ContextLoader(); >>>>> setApplicationContext( >>>>>loader.initWebApplicationContext(servletContext) ); >>>>> >>>>>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 = make >>>>>use of the OpenSessionInViewFilter. >>>>> >>>>>Any ideas? >>>>> >>>>> >>>>>Cheers, >>>>> >>>>>Ross >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 = admin. >>>>>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-develop= er >>>>> >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 = admin. >>>>>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-develop= er >>>>> >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>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 = admin. >>>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>>_______________________________________________ >>>>Springframework-developer mailing list >>>>Spr...@li... >>>>https://lists.sourceforge.net/lists/listinfo/springframework-develope= r >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>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 = admin. >>>>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-develope= r >>>> >>> >>> >>> >>> >>>------------------------------------------------------- >>>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 = admin. >>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer= >>> >>> >>> >>> >>>------------------------------------------------------- >>>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 = admin. >>>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= >>> >> >> >> >> >>------------------------------------------------------- >>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 = admin. >>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >>------------------------------------------------------- >>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 = admin. >>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 >=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 = admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=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 = admin. > 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 ------------------------------------------------------- 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 = admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Ross M. <ro...@at...> - 2003-12-22 23:07:47
|
Hi J=FCrgen, i've been testing against the lastest M4 src and everything seems to be=20 fine. So we have migrated to your OpenSessionInViewFilter. As usual=20 guys, things just work properly... Well done! Cheers, Ross j=FCrgen h=F6ller [werk3AT] wrote: > FYI, we've migrated our AOP framework to CGLIB2 today, also shipping Hi= bernate 2.1.1 now and building Spring against it. This will be the basis = for 1.0 M4, to be released mid next week. So there shouldn't be any poten= tial for Hibernate 2.1/CGLIB2 issues anymore! >=20 > Finally, congratulations on your beta, of course! >=20 > Juergen >=20 >=20 > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Ross Mason > Sent: Friday, December 19, 2003 9:23 AM > To: spr...@li... > Subject: Re: [Springframework-developer] Refreshing the > ApplicationContext... >=20 >=20 > Hi J=FCrgen, >=20 > Just to let you know I didn't have time today to try out the=20 > OpenSessionInViewFilter, we've been busy doing a release of Confluence=20 > beta1. I'll try it out on Monday now. > I remember last week there were some postings about removing/changing=20 > the Spring Wiki, so you might be interested in checking out=20 > http://confluence.atlassian.com. And of course it's using Spring ;-) >=20 > Have a good weekend, >=20 > Ross >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 >=20 >>Ross, >> >>I've just re-tested Petclinic from our current CVS HEAD against a dropp= ed-in Hibernate 2.1 final (plus cglib2, minus cglib-asm), with and withou= t OpenSessionInViewFilter. Works nicely for me - no VerifyErrors. Could y= ou please re-try and re-report if there are still issues? >> >>Note that the AOP framework is not migrated to CGLIB2 yet (it's in the = works), but this shouldn't affect you at all if you just proxy via interf= aces (the default). Simply remove cglib-asm from the class path, drop in = hibernate2, cglib2, eh-cache - and you should be done. >> >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...]On Behalf >>Of Ross Mason >>Sent: Tuesday, December 16, 2003 11:46 PM >>To: spr...@li... >>Subject: Re: [Springframework-developer] Refreshing the >>ApplicationContext... >> >> >>Hi j=FCrgen, >> >>Sounds interesting, anything without EJB is always a bonus in my book -= =20 >>excuse the pun ;-) >> >>We've actually decided to wait for the M4 release before migrating. Th= e=20 >>problem is that we're using a hibernate 2.1 jar built from HEAD and I=20 >>was getting VerifyErrors errors when running with the latest from Sprin= g=20 >>HEAD due to an incompatability with the two jars. >> >>If you would like me to test it once M4 is using hibernate 2.1 and=20 >>before you make the actual release I would be happy to. >> >>Cheers, >> >>Ross >> >>j=FCrgen h=F6ller [werk3AT] wrote: >> >> >> >>>It's "J2EE Development Without EJB", co-authored by Rod and me, the fo= llow-up to Rod's "J2EE Design and Development". Editing deadline is mid J= anuary, so you can guess that we're quite busy! >>> >>>Of course, the book uses Spring for all examples - but it is an archit= ecture book, not a Spring tutorial. A dedicated Spring book will follow l= ater next year :-) >>> >>>BTW, does the OpenSessionInViewFilter work for you? If there are any i= ssues with it, please tell me before the M4 release... >>> >>>Finally, is there some documentation on the "external-ref" mechanism t= hat you use for XWork/Spring integration? We will probably refer to that = in Spring docs and the book, so I'd like to make sure that we get the syn= tax right. >>> >>>Juergen >>> >>> >>>-----Original Message----- >>>From: spr...@li... >>>[mailto:spr...@li...]On Behal= f >>>Of Ross Mason >>>Sent: Tuesday, December 16, 2003 3:39 AM >>>To: spr...@li... >>>Subject: Re: [Springframework-developer] Refreshing the >>>ApplicationContext... >>> >>> >>>Ok mate, sounds like it's time for you to hit the sack. >>> >>>BTW What's the book? you can tell me in the morning ;-) >>> >>>Cheers, >>> >>>Ross >>> >>>j=FCrgen h=F6ller [werk3AT] wrote: >>> >>> >>> >>> >>>>I could have thought of that if it wasn't already so late (3:20 in th= e morning now). Yes, that's a known limitation: If you proxy an object, b= oth the proxy and the target object will match the type. You need to reso= rt to explicit references for such beans - as I said, this will even work= for specific references if you apply autowire-by-type in general. >>>> >>>>BTW, have I mentioned that writing a book is *damn hard work*? ;-) >>>> >>>>Juergen >>>> >>>> >>>>________________________________ >>>> >>>>Von: spr...@li... im Auftrag= von Ross Mason >>>>Gesendet: Di 16.12.2003 02:23 >>>>An: spr...@li... >>>>Betreff: Re: [Springframework-developer] Refreshing the ApplicationCo= ntext... >>>> >>>> >>>> >>>>Hi j=FCrgen, >>>> >>>>When I run getBeansOfType() on our config (turning off autowireByType= ) I >>>>do get two beans returned: >>>>- I get the emialTemplateManager as expected (this is a proxy >>>>org.springframework.transaction.interceptor.TransactionProxyFactoryBe= an). >>>>- I also get back our emailTemplateManagerTarget which is our proxied >>>>object. >>>> >>>>This suggests you can't use autowireByType when using >>>>TransactionProxyFactoryBean or any other ProxyFactoryBean. Is this >>>>intended behaviour? >>>> >>>>Cheers, >>>> >>>>Ross >>>> >>>> >>>>j=FCrgen h=F6ller [werk3AT] wrote: >>>> >>>> >>>> >>>> >>>> >>>>>Ross, >>>>> >>>>>If you build a single context from multiple files, autowiring will a= utomatically scan all the bean definitions in those files. In your case, = I assume that you do have multiple definitions of type EmailTemplateManag= er, possibly in two different context files. You could check that program= matically by examining the result of ApplicationContext.getBeansOfType(Em= ailTemplateManager.class, true, true). >>>>> >>>>>In any case, even if you apply autowiring in general, you can always= override a specific dependency, like an explicit bean reference from pro= perty "emailTemplateManager" of bean "notifierCreatePage" to a specific b= ean of type EmailTemplateManager: >>>>> >>>>><bean id=3D"notifierCreatePage" class=3D"..." autowire=3D"byType"> >>>>><property name=3D"emailTemplateManager"><ref bean=3D"myEmailTemplate= Manager"/></property> >>>>>... >>>>></bean> >>>>> >>>>>Juergen >>>>> >>>>> >>>>>________________________________ >>>>> >>>>>Von: spr...@li... im Auftra= g von Ross Mason >>>>>Gesendet: Di 16.12.2003 01:00 >>>>>An: spr...@li... >>>>>Betreff: Re: [Springframework-developer] Refreshing the ApplicationC= ontext... >>>>> >>>>> >>>>> >>>>>Hi j=FCrgen, >>>>> >>>>>We were using refresh as we needed to defer the initialisation of th= e >>>>>String container the first time our app is run until the user has se= tup >>>>>their db settings, at which point we initialise the container. Afte= r >>>>>that, if/when the server is restarted we use your ContextLoaderListe= ner >>>>>is used to initialise the container. >>>>> >>>>>I think I've just realised what the problem is. We have 3 >>>>>applicationContexts and the bean causing the error is defined in a >>>>>different context. Is there a way to autowire over multiple context= s? >>>>> >>>>>If this is the case, the exception for this scenario is a bit mislea= ding >>>>>as it tells me there is more than one satifiable dependency. >>>>> >>>>>The exception we get is - >>>>>org.springframework.beans.FatalBeanException: Can't resolve referenc= e to >>>>>bean 'notifierCreatePage' while setting property 'listeners[0]' on b= ean >>>>>'producerCreatePage'; nested exception is: >>>>>org.springframework.beans.factory.UnsatisfiedDependencyException: Be= an >>>>>with name 'notifierCreatePage' has an unsatisfied dependency express= ed >>>>>through property 'emailTemplateManager': set this property value or >>>>>disable dependency checking for this bean; detail message =3D [There= are 2 >>>>>beans of type [interface >>>>>com.atlassian.confluence.mail.template.EmailTemplateManager] for >>>>>autowire by type. There should have been 1 to be able to autowire >>>>>property 'emailTemplateManager' of bean 'notifierCreatePage'.] >>>>>(This is very informative excetion BTW ;-)) >>>>> >>>>>Cheers, >>>>> >>>>>Ross >>>>> >>>>> >>>>>j=FCrgen h=F6ller [werk3AT] wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>Hi Ross, >>>>>> >>>>>>"refresh" is now in ConfigurableApplicationContext, but you shouldn= 't need that for typical usages anyway. I guess what you're trying to do = is custom initialization of the root WebApplicationContext, storing it in= a custom place via the setApplicationContext call. That should be fine: = I suppose that the error you're getting has other origins. Autowiring has= been significantly reworked; could you check for which components you ge= t more than one matching bean? The reason could be that you actually *hav= e* multiple matching beans, which just weren't found by M2's autowire imp= lementation, maybe due to being created by FactoryBeans. Could you quote = relevant parts of your configuration? >>>>>> >>>>>>Juergen >>>>>> >>>>>> >>>>>>________________________________ >>>>>> >>>>>>Von: spr...@li... im Auftr= ag von Ross Mason >>>>>>Gesendet: Mo 15.12.2003 07:50 >>>>>>An: spr...@li... >>>>>>Betreff: [Springframework-developer] Refreshing the ApplicationCont= ext... >>>>>> >>>>>> >>>>>> >>>>>>Hi, >>>>>> >>>>>>In the latest source the ApplicationContext.refresh() method has be= en >>>>>>removed. What is the recommended way of refreshing an >>>>>>applicationContext now. I'm trying - >>>>>> >>>>>> ContextLoader loader =3D new ContextLoader(); >>>>>> setApplicationContext( >>>>>>loader.initWebApplicationContext(servletContext) ); >>>>>> >>>>>>But I am getting an error saying that there is more than one matchi= ng >>>>>>bean on some components when autoWiring by type. Our code and cofi= g >>>>>>works fine with M2 release, but we're mored to the latest source to= make >>>>>>use of the OpenSessionInViewFilter. >>>>>> >>>>>>Any ideas? >>>>>> >>>>>> >>>>>>Cheers, >>>>>> >>>>>>Ross >>>>>> >>>>>> >>>>>> >>>>>>------------------------------------------------------- >>>>>>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 = admin. >>>>>>Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dc= lick >>>>>>_______________________________________________ >>>>>>Springframework-developer mailing list >>>>>>Spr...@li... >>>>>>https://lists.sourceforge.net/lists/listinfo/springframework-develo= per >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>------------------------------------------------------- >>>>>>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 = admin. >>>>>>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-develo= per >>>>>> >>>>> >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 a= dmin. >>>>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>>>_______________________________________________ >>>>>Springframework-developer mailing list >>>>>Spr...@li... >>>>>https://lists.sourceforge.net/lists/listinfo/springframework-develop= er >>>>> >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>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 a= dmin. >>>>>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-develop= er >>>>> >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>>Become an expert in LINUX or just sharpen your skills. Sign up for I= BM's >>>>Free Linux Tutorials. Learn everything from the bash shell to sys ad= min. >>>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>>_______________________________________________ >>>>Springframework-developer mailing list >>>>Spr...@li... >>>>https://lists.sourceforge.net/lists/listinfo/springframework-develope= r >>>> >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>>Become an expert in LINUX or just sharpen your skills. Sign up for I= BM's >>>>Free Linux Tutorials. Learn everything from the bash shell to sys ad= min. >>>>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-develope= r >>>> >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=3Dick >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: IBM Linux Tutorials. >>>Become an expert in LINUX or just sharpen your skills. Sign up for IB= M's >>>Free Linux Tutorials. Learn everything from the bash shell to sys adm= in. >>>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 >>> >> >> >> >> >>------------------------------------------------------- >>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=3Dick >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >>------------------------------------------------------- >>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 >=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=3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=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 |
|
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 |