Re: [Rife-users] Spring integration questions
Great work Steven! I will definitely include this in RIFE since as you say, many people will want to work like this. Do you think it's feasible to create some unit tests that check if this integration was done correctly (I know that this is currently not the case for the SpringWebParticipant)? I think that a good location would be src/ unittests/com/uwyn/rife/rep/ and maybe you can setup the required participant and context in programs/unittests/config/rep/ unittests_participants.xml and src/unittests/com/uwyn/rife/ TestRife.java. I haven't really thought this through though. I suppose you need to be careful to not interfere with existing repository tests and their properties. Maybe it's actually better to use your own mock repository for the test, as explained here: http:// rifers.org/wiki/display/RIFE/Repository+mocking+and+testing Take care, Geert On 20 Jul 2006, at 11:00, Steven Grimm wrote: Geert Bevin wrote: What would be swell would be a Spring participant that automatically adds all the Spring beans to the list of global RIFE properties. That way you wouldn't have to list the beans in two places. As long as Spring supports full introspection of the beans in the factory, that simply would be an extension of SpringWebParticipant. You can override the initialize() method. It's implementation would call parent.initialize() first and then you can use getRepository().getProperties() to obtain a handle on the global properties. These can then be filled in. This works great and I've posted code for it to the Wiki. Do you think it makes sense to include this as a part of RIFE? It seems to me that many (most?) people who want to mix Spring and RIFE will want to be able to freely inject all their Spring beans into RIFE elements. -Steve ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn "Use what you need" - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring integration questions
Geert Bevin wrote: What would be swell would be a Spring participant that automatically adds all the Spring beans to the list of global RIFE properties. That way you wouldn't have to list the beans in two places. As long as Spring supports full introspection of the beans in the factory, that simply would be an extension of SpringWebParticipant. You can override the initialize() method. It's implementation would call parent.initialize() first and then you can use getRepository().getProperties() to obtain a handle on the global properties. These can then be filled in. This works great and I've posted code for it to the Wiki. Do you think it makes sense to include this as a part of RIFE? It seems to me that many (most?) people who want to mix Spring and RIFE will want to be able to freely inject all their Spring beans into RIFE elements. -Steve ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring integration wiki page
Geert Bevin wrote: So it sounds like I should have my getInstance() method call waitUntilFinished() to force it to wait for the initialization to finish? (I'm subclassing BlockingParticipant.) I will update the Wiki. That's a good solution indeed. Turned out to be a bit more complicated than that because Spring creates a separate instance of my factory object (hence the need for static variables in the first place.) So calling waitUntilFinished() does no good, because the Spring-created instance of the factory will never finish its RIFE-side initialization! However, it's the right general idea; I implemented my own waitUntilFinished() logic that uses statics and it appears to work. I've updated the Wiki with the new code. -Steve ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring integration wiki page
Hi Steven, Ah, okay, that's good to know. In this case I actually need my participant to finish initializing before the Spring participant is launched, though -- if Spring calls my getInstance() method before RIFE has called my initialize() method, I won't have a Datasource to hand out. So it sounds like I should have my getInstance() method call waitUntilFinished() to force it to wait for the initialization to finish? (I'm subclassing BlockingParticipant.) I will update the Wiki. That's a good solution indeed. Take care, Geert -- Geert Bevin Uwyn "Use what you need" - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring integration wiki page
Geert Bevin wrote: thanks a lot for updating the wiki page with Spring information. I'm not so sure about the "Injecting RIFE objects into Spring beans" section though. Instead of aggregating the datasource in a static class variable that it afterwards accessible to Spring, isn't it possible to inject bean declarations into the Spring bean factory using a participant? If I do it using a subclass of ParticipantSpringWeb, maybe. I'll try that tomorrow. The problem is that Spring doesn't really support adding beans on the fly (or at least not as far as I'm aware) -- the beans pretty much have to all be available when Spring starts up so it can create everything in the right order to satisfy dependencies. So in any event the RIFE objects would have to be ready to go before the Spring initialization. Another minor note: "The order is important here: our factory has to come after all the resources it wants to supply to Spring, and before the Spring participant. Otherwise Spring might try to call it before it has the objects it needs." This is not correct. Participants are not sequentially initialized unless you add set the blocking attribute to true. Otherwise, they are all just launched in a separate thread and do their thing. THe getObject(s) methods are wrapped to the any thread that obtains a participant data object is but into a wait state until the initialization is finishes. This allows an application to start up as fast as possible with only delays when data is really needed from a participant that hasn't finished initializing yet. Ah, okay, that's good to know. In this case I actually need my participant to finish initializing before the Spring participant is launched, though -- if Spring calls my getInstance() method before RIFE has called my initialize() method, I won't have a Datasource to hand out. So it sounds like I should have my getInstance() method call waitUntilFinished() to force it to wait for the initialization to finish? (I'm subclassing BlockingParticipant.) I will update the Wiki. -Steve ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring integration questions
Geert Bevin wrote: That's not necessarily true, you can have both a RIFE and a Spring application running side-to-side in the same web application. If you use the ParticipantSpringWeb participant without a parameter, it will obtain the Spring BeanFactory from the web application context. Ah, okay. I don't really have a use for that in my situation, at least not right now -- has someone else done this? If so, maybe you (the person who's done it) can add an example to the Wiki page. The only clean solution I can think of is to write a factory class for the Spring side that does static method calls to grab a Datasource from RIFE. That seems wasteful, though -- there ought to be some way for RIFE to inject dependencies into Spring, since it has already made a Datasource for me. I'm sorry, my Spring-foo is not good enough atm to be able to answer this correctly. Maybe this is something that you can also add to the initialize method overriding solution that I describe below. Yes, probably my factory class could be combined with the Spring web participant. I'll try that out tomorrow. What would be swell would be a Spring participant that automatically adds all the Spring beans to the list of global RIFE properties. That way you wouldn't have to list the beans in two places. As long as Spring supports full introspection of the beans in the factory, that simply would be an extension of SpringWebParticipant. You can override the initialize() method. It's implementation would call parent.initialize() first and then you can use getRepository().getProperties() to obtain a handle on the global properties. These can then be filled in. Yes, Spring allows you to list the beans. I will give that a try tomorrow; if it works at all it should be pretty simple. Hope this helps, It does! -Steve ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Spring integration wiki page
Hi Steven, thanks a lot for updating the wiki page with Spring information. I'm not so sure about the "Injecting RIFE objects into Spring beans" section though. Instead of aggregating the datasource in a static class variable that it afterwards accessible to Spring, isn't it possible to inject bean declarations into the Spring bean factory using a participant? Another minor note: "The order is important here: our factory has to come after all the resources it wants to supply to Spring, and before the Spring participant. Otherwise Spring might try to call it before it has the objects it needs." This is not correct. Participants are not sequentially initialized unless you add set the blocking attribute to true. Otherwise, they are all just launched in a separate thread and do their thing. THe getObject(s) methods are wrapped to the any thread that obtains a participant data object is but into a wait state until the initialization is finishes. This allows an application to start up as fast as possible with only delays when data is really needed from a participant that hasn't finished initializing yet. Best regards, Geert -- Geert Bevin Uwyn "Use what you need" - http://uwyn.com RIFE Java application framework - http://rifers.org Music and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring integration questions
I played with this some more and got it working; I'm now pretty sure my understanding was essentially correct. So I have documented it in the Wiki to save the next person the legwork. http://rifers.org/wiki/display/RIFE/Spring+integration I also implemented a slightly less ugly variant of the idea at the bottom of my previous message, which seems to work but may not be the best way to solve the problem. I've put that up on the Wiki page too; if there's a more elegant way to feed RIFE objects into Spring's dependency injection system, please tell me! -Steve ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring integration questions
Hi Steven,first of all, I have very little experience with Spring, but I know that other people are using it together with RIFE.I want to do some more advanced dependency injection (DAOs and other service objects) so I started looking at Spring integration. I have some questions. First, do I have a correct picture of how it works? (I will definitely put this on the Wiki; the page on Spring integration is tiny at the moment.) RIFE is the outermost entity (that is, Spring is a service managed by RIFE, not the other way around).That's not necessarily true, you can have both a RIFE and a Spring application running side-to-side in the same web application. If you use the ParticipantSpringWeb participant without a parameter, it will obtain the Spring BeanFactory from the web application context. Each RIFE participant can supply values for properties that are declared in the site declaration or element declarations or wherever. The Spring participant simply supplies beans to RIFE based on the bean names.Correct. RIFE does the actual injection of values into elements and other RIFE-managed objects.Only into elements atm. Spring does the wiring of dependencies between Spring-managed beans; RIFE does no injection of values into objects Spring instantiates.Correct. It would be a bad idea to list the same object in both the Spring and the RIFE configuration since only one or the other would actually do any dependency injection.Correct. Assuming I'm correct about how it works, is the intended usage as follows if I want everything to be autowired as much as possible? Declare all my service objects in Spring and let it wire them up. Declare all my elements in the RIFE configuration as usual.Also declare each service object in my RIFE site definition (so they don't have to be declared for individual elements). They are just declared as . In my element classes, provide setters of compatible types for both the Spring beans and the RIFE-managed resources like Datasource objects.Yes, that seems correct. Note that when you provide a value to a property you can use the tag to retrieve an object from the Spring participant. And assuming I've got *that* more or less right, I am unclear on how to do one more thing: pass a RIFE-managed resource into the Spring world for autowiring. The simple example would be a DAO that uses RIFE's database APIs; I will need to use Spring to instantiate that DAO and wire it with other non-element objects, but the DAO needs to be injected with a Datasource object in order to use the RIFE APIs. How do I tell RIFE and Spring that there's this externally-supplied object that should be added to the autowiring mix? The only clean solution I can think of is to write a factory class for the Spring side that does static method calls to grab a Datasource from RIFE. That seems wasteful, though -- there ought to be some way for RIFE to inject dependencies into Spring, since it has already made a Datasource for me.I'm sorry, my Spring-foo is not good enough atm to be able to answer this correctly. Maybe this is something that you can also add to the initialize method overriding solution that I describe below. What would be swell would be a Spring participant that automatically adds all the Spring beans to the list of global RIFE properties. That way you wouldn't have to list the beans in two places. As long as Spring supports full introspection of the beans in the factory, that simply would be an extension of SpringWebParticipant. You can override the initialize() method. It's implementation would call parent.initialize() first and then you can use getRepository().getProperties() to obtain a handle on the global properties. These can then be filled in.Hope this helps,Geert --Geert Bevin Uwyn "Use what you need" - http://uwyn.comRIFE Java application framework - http://rifers.orgMusic and words - http://gbevin.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Spring integration questions
I want to do some more advanced dependency injection (DAOs and other service objects) so I started looking at Spring integration. I have some questions. First, do I have a correct picture of how it works? (I will definitely put this on the Wiki; the page on Spring integration is tiny at the moment.) RIFE is the outermost entity (that is, Spring is a service managed by RIFE, not the other way around). Each RIFE participant can supply values for properties that are declared in the site declaration or element declarations or wherever. The Spring participant simply supplies beans to RIFE based on the bean names. RIFE does the actual injection of values into elements and other RIFE-managed objects. Spring does the wiring of dependencies between Spring-managed beans; RIFE does no injection of values into objects Spring instantiates. It would be a bad idea to list the same object in both the Spring and the RIFE configuration since only one or the other would actually do any dependency injection. Assuming I'm correct about how it works, is the intended usage as follows if I want everything to be autowired as much as possible? Declare all my service objects in Spring and let it wire them up. Declare all my elements in the RIFE configuration as usual. Also declare each service object in my RIFE site definition (so they don't have to be declared for individual elements). They are just declared as . In my element classes, provide setters of compatible types for both the Spring beans and the RIFE-managed resources like Datasource objects. And assuming I've got *that* more or less right, I am unclear on how to do one more thing: pass a RIFE-managed resource into the Spring world for autowiring. The simple example would be a DAO that uses RIFE's database APIs; I will need to use Spring to instantiate that DAO and wire it with other non-element objects, but the DAO needs to be injected with a Datasource object in order to use the RIFE APIs. How do I tell RIFE and Spring that there's this externally-supplied object that should be added to the autowiring mix? The only clean solution I can think of is to write a factory class for the Spring side that does static method calls to grab a Datasource from RIFE. That seems wasteful, though -- there ought to be some way for RIFE to inject dependencies into Spring, since it has already made a Datasource for me. What would be swell would be a Spring participant that automatically adds all the Spring beans to the list of global RIFE properties. That way you wouldn't have to list the beans in two places. -Steve ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] spring integration
Is there a working example of Spring and Rife working together? I've searched through the wiki and can't find a simple example to get going with quickly. TIA, Graham ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Fwd: Re: [Rife-users] Spring]
It's important for people to be able to integrate with existing solutions. Also, Spring provides a very good middleware framework to allow you to integrate with a whole collection of 3rd party libraries in a consistent manner. As an IoC container it's also very good. However, if you don't miss Spring, you'll probably not need it if you're already using RIFE ;-) On 10 Dec 2005, at 22:58, Emmanuel Okyere wrote: Like fbaube, i'm wondering what spring brings to rife that rife doesn't already do? does it in some way make something more easier/intuitive to do? does it bring additional features? or is it just added in to allow people who already know spring to easily migrate to rife? --eokyere On 12/10/05, Raoul Pierre <[EMAIL PROTECTED]> wrote: F Baube a écrit : Could anyone describe what Spring integration brings to Rife ? You can look at the files I just sent about l10n. I used Spring to do IoC for the LocaleProvider: The choice of the LocalProvider implementation is done from the file localesContext.xml. But Spring is a pretty big system, isn't it ? Yes (1.7 mo) but still acceptable. I'm wondering about the "big picture" ... because I'm very curious ... Rife covers _so_ much, so what does Spring offer that integrates more or less orthogonally. Atm, Rife only allows string injection, not object value. See http://rifers.org/wiki/display/RIFE/Add+full+IoC+support Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Fwd: Re: [Rife-users] Spring]
Like fbaube, i'm wondering what spring brings to rife that rife doesn't already do? Atm, Rife only allows string injection, not object injection. So yes, here we still need any IoC containers such as Spring, Pico... And as Rife already has a Spring participant... That's actually not entirely correct. RIFE supports injection of any kind of object and will try its best to convert between types. RIFE however supports nothing like a reference factory. We actually split up IoC in the two important actions: * injection * reference provision Providing the references is done through participants at this time, since each participant has the capability of returning a value according to a key. You can code a reference factory participant yourself very easily without using any IoC container. Just return the values from a pre-populated map, and that's it. There is a Spring participant for integration into existing apps, but also because it's a damn fine reference factoring and dependency resolver. In one of the next versions I still think it's good to implement what is described in the URL you mention. See http://rifers.org/wiki/display/RIFE/Add+full+IoC+support -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Fwd: Re: [Rife-users] Spring]
Emmanuel Okyere a écrit : Like fbaube, i'm wondering what spring brings to rife that rife doesn't already do? Atm, Rife only allows string injection, not object injection. So yes, here we still need any IoC containers such as Spring, Pico... And as Rife already has a Spring participant... See http://rifers.org/wiki/display/RIFE/Add+full+IoC+support does it in some way make something more easier/intuitive to do? does it bring additional features? Yes, if you want to use AOP, Spring does the job. (AspectJ is more powerful, but it's about 2.1 Mo for the version 5) Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Fwd: Re: [Rife-users] Spring]
Like fbaube, i'm wondering what spring brings to rife that rife doesn't already do? does it in some way make something more easier/intuitive to do? does it bring additional features? or is it just added in to allow people who already know spring to easily migrate to rife? --eokyere On 12/10/05, Raoul Pierre <[EMAIL PROTECTED]> wrote: > F Baube a écrit : > > >>>Could anyone describe what Spring integration brings to Rife ? > >>> > >>> > >>You can look at the files I just sent about l10n. I used Spring > >>to do IoC for the LocaleProvider: The choice of the LocalProvider > >>implementation is done from the file localesContext.xml. > >> > >> > > > >But Spring is a pretty big system, isn't it ? > > > > > > Yes (1.7 mo) but still acceptable. > > >I'm wondering about the "big picture" ... because I'm very curious ... > >Rife covers _so_ much, so what does Spring offer that integrates more > >or less orthogonally. > > > > > > > > Atm, Rife only allows string injection, not object value. See > http://rifers.org/wiki/display/RIFE/Add+full+IoC+support > > Pierre > > > > > > > ___ > Rife-users mailing list > Rife-users@uwyn.com > http://www.uwyn.com/mailman/listinfo/rife-users > ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Fwd: Re: [Rife-users] Spring]
F Baube a écrit : Could anyone describe what Spring integration brings to Rife ? You can look at the files I just sent about l10n. I used Spring to do IoC for the LocaleProvider: The choice of the LocalProvider implementation is done from the file localesContext.xml. But Spring is a pretty big system, isn't it ? Yes (1.7 mo) but still acceptable. I'm wondering about the "big picture" ... because I'm very curious ... Rife covers _so_ much, so what does Spring offer that integrates more or less orthogonally. Atm, Rife only allows string injection, not object value. See http://rifers.org/wiki/display/RIFE/Add+full+IoC+support Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
> >Could anyone describe what Spring integration brings to Rife ? > > You can look at the files I just sent about l10n. I used Spring > to do IoC for the LocaleProvider: The choice of the LocalProvider > implementation is done from the file localesContext.xml. But Spring is a pretty big system, isn't it ? I'm wondering about the "big picture" ... because I'm very curious ... Rife covers _so_ much, so what does Spring offer that integrates more or less orthogonally. fred ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
F Baube a écrit : I haven't looked at Spring. Could anyone describe what Spring integration brings to Rife ? You can look at the files I just sent about l10n. I used Spring to do IoC for the LocaleProvider: The choice of the LocalProvider implementation is done from the file localesContext.xml. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Spring
I haven't looked at Spring. Could anyone describe what Spring integration brings to Rife ? thx fred -- F.Baube* Georgetown/MSFS/1988 * Act locally. email fbaube#welho.com * Think pangalactically. gsm +358 41 536 8192 * wmd 60°11'10.8"N 24°57'36.9"E ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
You could try this: http://static.springframework.org/spring/docs/1.2.x/api/org/ springframework/core/io/DefaultResourceLoader.html#setClassLoader (java.lang.ClassLoader) On 6-dec-05, at 16:56, Geert Bevin wrote: Well then it's clear that 2 different classloaders are loading the same class, RIFE's classloader and the system classloader. Either Spring doesn't respect the classloader hierarchy, by first asking to the classloader that loaded the ApplicationContext, either you need to provide it with an explicit parent classloader. On 6-dec-05, at 16:45, Raoul Pierre wrote: Geert, That's of the Home class, no? Not of the Version class? In the Home class, I have: ApplicationContext ctx = new FileSystemXmlApplicationContext("c:/ DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml"); Object bozo1 = ctx.getBean("appBozoTarget"); Bozo bozo2 = new Bozo(); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean hashcode: "+ bozo1.hashCode()); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct hashcode: "+bozo2.hashCode()); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean classloader type/hashcode: " + bozo1.getClass().getClassLoader().getClass ().getName() +" / " + bozo1.getClass().getClassLoader().hashCode() ); System.out.println ("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct classloader type/hashcode: " + bozo2.getClass().getClassLoader().getClass ().getName() +" / " + bozo2.getClass().getClassLoader().hashCode() ); Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Well then it's clear that 2 different classloaders are loading the same class, RIFE's classloader and the system classloader. Either Spring doesn't respect the classloader hierarchy, by first asking to the classloader that loaded the ApplicationContext, either you need to provide it with an explicit parent classloader. On 6-dec-05, at 16:45, Raoul Pierre wrote: Geert, That's of the Home class, no? Not of the Version class? In the Home class, I have: ApplicationContext ctx = new FileSystemXmlApplicationContext("c:/ DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml"); Object bozo1 = ctx.getBean("appBozoTarget"); Bozo bozo2 = new Bozo(); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean hashcode: "+ bozo1.hashCode()); System.out.println ("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct hashcode: "+bozo2.hashCode()); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean classloader type/hashcode: " + bozo1.getClass().getClassLoader().getClass ().getName() +" / " + bozo1.getClass().getClassLoader().hashCode() ); System.out.println ("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct classloader type/hashcode: " + bozo2.getClass().getClassLoader().getClass ().getName() +" / " + bozo2.getClass().getClassLoader().hashCode() ); Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Geert, That's of the Home class, no? Not of the Version class? In the Home class, I have: ApplicationContext ctx = new FileSystemXmlApplicationContext("c:/DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml"); Object bozo1 = ctx.getBean("appBozoTarget"); Bozo bozo2 = new Bozo(); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean hashcode: "+ bozo1.hashCode()); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct hashcode: "+bozo2.hashCode()); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean classloader type/hashcode: " + bozo1.getClass().getClassLoader().getClass().getName() +" / " + bozo1.getClass().getClassLoader().hashCode() ); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct classloader type/hashcode: " + bozo2.getClass().getClassLoader().getClass().getName() +" / " + bozo2.getClass().getClassLoader().hashCode() ); Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
That's of the Home class, no? Not of the Version class? On 6-dec-05, at 16:19, Raoul Pierre wrote: Geert, Could you do this on the class and the instance that aren't compatible: com.uwyn.ecalendar.elements.Version.class.getClassLoader ().getClass ().getName(); com.uwyn.ecalendar.elements.Version.class.getClassLoader().hashCode (); instance.getClass().getClassLoader().getClass().getName(); instance.getClass().getClassLoader().hashCode(); Sorry not to have told you that it was at the end of the output: [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: sun.misc.Launcher$AppClassLoader [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: com.uwyn.rife.engine.EngineClassLoader [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean hashcode: 15470939 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct hashcode: 6789355 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean classloader type/hashcode: sun.misc.Launcher$AppClassLoader / 20120943 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct classloader type/hashcode: com.uwyn.rife.engine.EngineClassLoader / 20812788 Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Geert, Could you do this on the class and the instance that aren't compatible: com.uwyn.ecalendar.elements.Version.class.getClassLoader().getClass ().getName(); com.uwyn.ecalendar.elements.Version.class.getClassLoader().hashCode(); instance.getClass().getClassLoader().getClass().getName(); instance.getClass().getClassLoader().hashCode(); Sorry not to have told you that it was at the end of the output: [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: sun.misc.Launcher$AppClassLoader [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: com.uwyn.rife.engine.EngineClassLoader [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean hashcode: 15470939 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct hashcode: 6789355 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean classloader type/hashcode: sun.misc.Launcher$AppClassLoader / 20120943 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct classloader type/hashcode: com.uwyn.rife.engine.EngineClassLoader / 20812788 Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Could you do this on the class and the instance that aren't compatible: com.uwyn.ecalendar.elements.Version.class.getClassLoader().getClass ().getName(); com.uwyn.ecalendar.elements.Version.class.getClassLoader().hashCode(); instance.getClass().getClassLoader().getClass().getName(); instance.getClass().getClassLoader().hashCode(); On 6-dec-05, at 15:56, Raoul Pierre wrote: Geert, Ok, then you either have two versions of that class, either the same class is loaded by different classloaders. Can you get the class's classloader's classname and again the instance hashcode? The Bozo class doesn't extend any other class and is only called by Home class. No other Bozo class. Only in applicationContext2.xml Then: 6 déc. 2005 15:50:20 org.mortbay.http.SocketListener start INFO: Started SocketListener on 0.0.0.0:8008 6 déc. 2005 15:50:20 org.mortbay.util.Container start INFO: Started [EMAIL PROTECTED] 6 déc. 2005 15:50:20 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization started 6 déc. 2005 15:50:20 org.mortbay.jetty.servlet.ServletHandler $Context log INFO: Loading Spring root WebApplicationContext 6 déc. 2005 15:50:21 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from ServletContext resource [/ WEB-INF/applicationContext2.xml] 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractRefreshableApplicationCont ext refreshBeanFactory INFO: Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory d efining beans [appBozoTarget]; root of BeanFactory hierarchy 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext refresh INFO: 1 beans defined in application context [Root WebApplicationContext] 6 déc. 2005 15:50:21 org.springframework.core.CollectionFactory INFO: JDK 1.4+ collections available 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext initMessageSource INFO: Unable to locate MessageSource with name 'messageSource': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [EMAIL PROTECTED] 02928] 6 déc. 2005 15:50:21 org.springframework.ui.context.support.UiApplicationContextUtils initThemeSource INFO: No ThemeSource found for [Root WebApplicationContext]: using ResourceBundleThemeSource 6 déc. 2005 15:50:21 org.springframework.beans.factory.support.DefaultListableBeanFactory p reInstantiateSingletons INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy] 6 déc. 2005 15:50:21 org.springframework.beans.factory.support.AbstractBeanFactory getBean INFO: Creating shared instance of singleton bean 'appBozoTarget' [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: com.uwyn.rife.engine.EngineClassLoader 6 déc. 2005 15:50:22 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for root WebApplicationContext 6 déc. 2005 15:50:22 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization completed in 1797 ms 6 déc. 2005 15:50:45 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [c:\DEV\Rife\rife- popsuite\web\WEB-INF\applicationContext2.xml] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractRefreshableApplicationCont ext refreshBeanFactory INFO: Bean factory for application context [org.springframework.context.support.FileSystemXmlApplicationContext;h ashCode=31147154]: org.springframework.beans.factory.support.DefaultListableBeanFactory d efining beans [appBozoTarget]; root of BeanFactory hierarchy 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext refresh INFO: 1 beans defined in application context [org.springframework.context.support.FileSystemXmlApplicationContext;h ashCode=31147154] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext initMessageSource INFO: Unable to locate MessageSource with name 'messageSource': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [EMAIL PROTECTED] 429d7] 6 déc. 2005 15:50:45 org.springframework.beans.factory.support.Defa
Re: [Rife-users] Spring
Geert, Ok, then you either have two versions of that class, either the same class is loaded by different classloaders. Can you get the class's classloader's classname and again the instance hashcode? The Bozo class doesn't extend any other class and is only called by Home class. No other Bozo class. Only in applicationContext2.xml Then: 6 déc. 2005 15:50:20 org.mortbay.http.SocketListener start INFO: Started SocketListener on 0.0.0.0:8008 6 déc. 2005 15:50:20 org.mortbay.util.Container start INFO: Started [EMAIL PROTECTED] 6 déc. 2005 15:50:20 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization started 6 déc. 2005 15:50:20 org.mortbay.jetty.servlet.ServletHandler$Context log INFO: Loading Spring root WebApplicationContext 6 déc. 2005 15:50:21 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext2.xml] 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory INFO: Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext refresh INFO: 1 beans defined in application context [Root WebApplicationContext] 6 déc. 2005 15:50:21 org.springframework.core.CollectionFactory INFO: JDK 1.4+ collections available 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext initMessageSource INFO: Unable to locate MessageSource with name 'messageSource': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:21 org.springframework.ui.context.support.UiApplicationContextUtils initThemeSource INFO: No ThemeSource found for [Root WebApplicationContext]: using ResourceBundleThemeSource 6 déc. 2005 15:50:21 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy] 6 déc. 2005 15:50:21 org.springframework.beans.factory.support.AbstractBeanFactory getBean INFO: Creating shared instance of singleton bean 'appBozoTarget' [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: com.uwyn.rife.engine.EngineClassLoader 6 déc. 2005 15:50:22 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for root WebApplicationContext 6 déc. 2005 15:50:22 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization completed in 1797 ms 6 déc. 2005 15:50:45 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [c:\DEV\Rife\rife-popsuite\web\WEB-INF\applicationContext2.xml] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory INFO: Bean factory for application context [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=31147154]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext refresh INFO: 1 beans defined in application context [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=31147154] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext initMessageSource INFO: Unable to locate MessageSource with name 'messageSource': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:45 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy] 6 déc. 2005 15:50:45 org.springframework.beans.factory.support.AbstractBeanFactory getBean INFO: Creating shared instance of singleton bean 'appBozoTarget' [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: sun.misc.Launcher$A
Re: [Rife-users] Spring
Ok, then you either have two versions of that class, either the same class is loaded by different classloaders. Can you get the class's classloader's classname and again the instance hashcode? On 6-dec-05, at 15:07, Raoul Pierre wrote: Geert, Can you output the both values of com.uwyn.ecalendar.elements.Version.class.hashcode() ? There are different: [com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class, direct hashcode: 5884890 [com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class, bean hashcode: 22445676 Pierre On 6-dec-05, at 13:35, Raoul Pierre wrote: Hello Seems that for Spring "A" is not "A"... Any idea? Pierre (The code is after the exception) /org.springframework.beans.factory.BeanNotOfRequiredTypeException/ *Bean named 'appVersionTarget' must be of type [com.uwyn.ecalendar.elements.Version], but was actually of type [com.uwyn.ecalendar.elements.Version]* at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 245 ) at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 151 ) at org.springframework.context.support.AbstractApplicationContext getBean ( AbstractApplicationContext.java : 552 ) at com.uwyn.rife.jumpstart.elements.pub.Home processElement( Home.java : 20 ) at com.uwyn.rife.engine.ElementContext processContext( ElementContext.java : 587 ) at com.uwyn.rife.engine.RequestStateservice ( RequestState.java : 212 ) at com.uwyn.rife.engine.GatehandleRequest ( Gate.java : 422 ) at com.uwyn.rife.engine.GatehandleRequest ( Gate.java : 240 ) at sun.reflect.NativeMethodAccessorImplinvoke0 ( NativeMethodAccessorImpl.java ) at sun.reflect.NativeMethodAccessorImplinvoke ( NativeMethodAccessorImpl.java : 39 ) at sun.reflect.DelegatingMethodAccessorImplinvoke ( DelegatingMethodAccessorImpl.java : 25 ) at java.lang.reflect.Methodinvoke ( Method.java : 585 ) at com.uwyn.rife.servlet.RifeFilterdoFilter ( RifeFilter.java : 112 ) at org.mortbay.jetty.servlet.WebApplicationHandler $CachedChaindoFilter ( WebApplicationHandler.java : 823 ) at org.mortbay.jetty.servlet.WebApplicationHandler dispatch( WebApplicationHandler.java : 473 ) at org.mortbay.jetty.servlet.ServletHandlerhandle ( ServletHandler.java : 567 ) at org.mortbay.http.HttpContexthandle ( HttpContext.java : 1565 ) *9 more ...* package com.uwyn.rife.jumpstart.elements.pub; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import com.uwyn.ecalendar.elements.Version; import com.uwyn.rife.engine.Element; import com.uwyn.rife.template.Template; public class Home extends Element { public void processElement() { ApplicationContext ctx = new FileSystemXmlApplicationContext("c:/ DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml"); Version v = (Version) ctx.getBean("appVersionTarget", Version.class); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class name: "+v.getClass().getName()); Template template = getHtmlTemplate("pub.home"); print(template); } } with applicationContext2.xml: www.springframework.org/dtd/spring-beans.dtd"> ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Geert, Can you output the both values of com.uwyn.ecalendar.elements.Version.class.hashcode() ? There are different: [com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class, direct hashcode: 5884890 [com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class, bean hashcode: 22445676 Pierre On 6-dec-05, at 13:35, Raoul Pierre wrote: Hello Seems that for Spring "A" is not "A"... Any idea? Pierre (The code is after the exception) /org.springframework.beans.factory.BeanNotOfRequiredTypeException/ *Bean named 'appVersionTarget' must be of type [com.uwyn.ecalendar.elements.Version], but was actually of type [com.uwyn.ecalendar.elements.Version]* at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 245 ) at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 151 ) at org.springframework.context.support.AbstractApplicationContext getBean ( AbstractApplicationContext.java : 552 ) at com.uwyn.rife.jumpstart.elements.pub.Home processElement( Home.java : 20 ) at com.uwyn.rife.engine.ElementContextprocessContext ( ElementContext.java : 587 ) at com.uwyn.rife.engine.RequestStateservice( RequestState.java : 212 ) at com.uwyn.rife.engine.GatehandleRequest ( Gate.java : 422 ) at com.uwyn.rife.engine.GatehandleRequest ( Gate.java : 240 ) at sun.reflect.NativeMethodAccessorImplinvoke0( NativeMethodAccessorImpl.java ) at sun.reflect.NativeMethodAccessorImplinvoke( NativeMethodAccessorImpl.java : 39 ) at sun.reflect.DelegatingMethodAccessorImplinvoke( DelegatingMethodAccessorImpl.java : 25 ) at java.lang.reflect.Methodinvoke ( Method.java : 585 ) at com.uwyn.rife.servlet.RifeFilterdoFilter( RifeFilter.java : 112 ) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain doFilter ( WebApplicationHandler.java : 823 ) at org.mortbay.jetty.servlet.WebApplicationHandler dispatch( WebApplicationHandler.java : 473 ) at org.mortbay.jetty.servlet.ServletHandlerhandle( ServletHandler.java : 567 ) at org.mortbay.http.HttpContexthandle ( HttpContext.java : 1565 ) *9 more ...* package com.uwyn.rife.jumpstart.elements.pub; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import com.uwyn.ecalendar.elements.Version; import com.uwyn.rife.engine.Element; import com.uwyn.rife.template.Template; public class Home extends Element { public void processElement() { ApplicationContext ctx = new FileSystemXmlApplicationContext("c:/ DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml"); Version v = (Version) ctx.getBean("appVersionTarget", Version.class); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class name: "+v.getClass().getName()); Template template = getHtmlTemplate("pub.home"); print(template); } } with applicationContext2.xml: www.springframework.org/dtd/spring-beans.dtd"> ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
I've seen this happen if you have two versions of the class on the classpathOn 12/6/05, Geert Bevin <[EMAIL PROTECTED] > wrote:Can you output the both values ofcom.uwyn.ecalendar.elements.Version.class.hashcode () ?On 6-dec-05, at 13:35, Raoul Pierre wrote:> Hello>> Seems that for Spring "A" is not "A"...>> Any idea?>> Pierre>> (The code is after the exception) >> /org.springframework.beans.factory.BeanNotOfRequiredTypeException/>> *Bean named 'appVersionTarget' must be of type> [com.uwyn.ecalendar.elements.Version], but was actually of type > [com.uwyn.ecalendar.elements.Version]*>> at org.springframework.beans.factory.support.AbstractBeanFactory> getBean ( AbstractBeanFactory.java : 245 )> at org.springframework.beans.factory.support.AbstractBeanFactory > getBean ( AbstractBeanFactory.java : 151 )> at> org.springframework.context.support.AbstractApplicationContext> getBean ( AbstractApplicationContext.java : 552 )> at com.uwyn.rife.jumpstart.elements.pub.Home processElement> ( Home.java : 20 )> at com.uwyn.rife.engine.ElementContext processContext> ( ElementContext.java : 587 )> at com.uwyn.rife.engine.RequestStateservice > ( RequestState.java : 212 )> at com.uwyn.rife.engine.GatehandleRequest( Gate.java : 422 )> at com.uwyn.rife.engine.GatehandleRequest( Gate.java : 240 )> at sun.reflect.NativeMethodAccessorImpl invoke0> ( NativeMethodAccessorImpl.java )> at sun.reflect.NativeMethodAccessorImpl invoke> ( NativeMethodAccessorImpl.java : 39 )> at sun.reflect.DelegatingMethodAccessorImpl invoke> ( DelegatingMethodAccessorImpl.java : 25 )> at java.lang.reflect.Method invoke ( Method.java : 585 )> at com.uwyn.rife.servlet.RifeFilter doFilter> ( RifeFilter.java : 112 )> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain> doFilter ( WebApplicationHandler.java : 823 )> at org.mortbay.jetty.servlet.WebApplicationHandler dispatch> ( WebApplicationHandler.java : 473 )> at org.mortbay.jetty.servlet.ServletHandler handle > ( ServletHandler.java : 567 )> at org.mortbay.http.HttpContext handle ( HttpContext.java :> 1565 )>> *9 more ...*>>> package com.uwyn.rife.jumpstart.elements.pub;>> import org.springframework.context.ApplicationContext; > import> org.springframework.context.support.FileSystemXmlApplicationContext;>> import com.uwyn.ecalendar.elements.Version;> import com.uwyn.rife.engine.Element;> import com.uwyn.rife.template.Template ;>> public class Home extends Element {>public void processElement() {> ApplicationContext ctx = new FileSystemXmlApplicationContext("c:/> DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml"); >> Version v = (Version) ctx.getBean("appVersionTarget", Version.class);> System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home]> popsuite version class name: "+v.getClass().getName()); >Template template = getHtmlTemplate("pub.home");>print(template);>}> }>> with applicationContext2.xml:>> > > www.springframework.org/dtd/spring-beans.dtd"> >> >> > class="com.uwyn.ecalendar.elements.Version"/>> > ___ > Rife-users mailing list> Rife-users@uwyn.com> http://www.uwyn.com/mailman/listinfo/rife-users >--Geert Bevin Uwyn bvba"Use what you need" Avenue de Scailmont 34http://www.uwyn.com 7170 Manage, Belgiumgbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___Rife-users mailing listRife-users@uwyn.comhttp://www.uwyn.com/mailman/listinfo/rife-users -- JR Boyens[EMAIL PROTECTED] ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Can you output the both values of com.uwyn.ecalendar.elements.Version.class.hashcode() ? On 6-dec-05, at 13:35, Raoul Pierre wrote: Hello Seems that for Spring "A" is not "A"... Any idea? Pierre (The code is after the exception) /org.springframework.beans.factory.BeanNotOfRequiredTypeException/ *Bean named 'appVersionTarget' must be of type [com.uwyn.ecalendar.elements.Version], but was actually of type [com.uwyn.ecalendar.elements.Version]* at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 245 ) at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 151 ) at org.springframework.context.support.AbstractApplicationContext getBean ( AbstractApplicationContext.java : 552 ) at com.uwyn.rife.jumpstart.elements.pub.Home processElement ( Home.java : 20 ) at com.uwyn.rife.engine.ElementContext processContext ( ElementContext.java : 587 ) at com.uwyn.rife.engine.RequestState service ( RequestState.java : 212 ) at com.uwyn.rife.engine.Gate handleRequest( Gate.java : 422 ) at com.uwyn.rife.engine.Gate handleRequest( Gate.java : 240 ) at sun.reflect.NativeMethodAccessorImpl invoke0 ( NativeMethodAccessorImpl.java ) at sun.reflect.NativeMethodAccessorImpl invoke ( NativeMethodAccessorImpl.java : 39 ) at sun.reflect.DelegatingMethodAccessorImpl invoke ( DelegatingMethodAccessorImpl.java : 25 ) at java.lang.reflect.Method invoke ( Method.java : 585 ) at com.uwyn.rife.servlet.RifeFilter doFilter ( RifeFilter.java : 112 ) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain doFilter ( WebApplicationHandler.java : 823 ) at org.mortbay.jetty.servlet.WebApplicationHandler dispatch ( WebApplicationHandler.java : 473 ) at org.mortbay.jetty.servlet.ServletHandler handle ( ServletHandler.java : 567 ) at org.mortbay.http.HttpContext handle ( HttpContext.java : 1565 ) *9 more ...* package com.uwyn.rife.jumpstart.elements.pub; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import com.uwyn.ecalendar.elements.Version; import com.uwyn.rife.engine.Element; import com.uwyn.rife.template.Template; public class Home extends Element { public void processElement() { ApplicationContext ctx = new FileSystemXmlApplicationContext("c:/ DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml"); Version v = (Version) ctx.getBean("appVersionTarget", Version.class); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class name: "+v.getClass().getName()); Template template = getHtmlTemplate("pub.home"); print(template); } } with applicationContext2.xml: www.springframework.org/dtd/spring-beans.dtd"> ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Spring
Hello Seems that for Spring "A" is not "A"... Any idea? Pierre (The code is after the exception) /org.springframework.beans.factory.BeanNotOfRequiredTypeException/ *Bean named 'appVersionTarget' must be of type [com.uwyn.ecalendar.elements.Version], but was actually of type [com.uwyn.ecalendar.elements.Version]* at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 245 ) at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 151 ) at org.springframework.context.support.AbstractApplicationContext getBean ( AbstractApplicationContext.java : 552 ) at com.uwyn.rife.jumpstart.elements.pub.Home processElement ( Home.java : 20 ) at com.uwyn.rife.engine.ElementContext processContext ( ElementContext.java : 587 ) at com.uwyn.rife.engine.RequestState service ( RequestState.java : 212 ) at com.uwyn.rife.engine.Gate handleRequest( Gate.java : 422 ) at com.uwyn.rife.engine.Gate handleRequest( Gate.java : 240 ) at sun.reflect.NativeMethodAccessorImpl invoke0 ( NativeMethodAccessorImpl.java ) at sun.reflect.NativeMethodAccessorImpl invoke ( NativeMethodAccessorImpl.java : 39 ) at sun.reflect.DelegatingMethodAccessorImpl invoke ( DelegatingMethodAccessorImpl.java : 25 ) at java.lang.reflect.Method invoke ( Method.java : 585 ) at com.uwyn.rife.servlet.RifeFilter doFilter ( RifeFilter.java : 112 ) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain doFilter ( WebApplicationHandler.java : 823 ) at org.mortbay.jetty.servlet.WebApplicationHandler dispatch ( WebApplicationHandler.java : 473 ) at org.mortbay.jetty.servlet.ServletHandler handle ( ServletHandler.java : 567 ) at org.mortbay.http.HttpContext handle ( HttpContext.java : 1565 ) *9 more ...* package com.uwyn.rife.jumpstart.elements.pub; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import com.uwyn.ecalendar.elements.Version; import com.uwyn.rife.engine.Element; import com.uwyn.rife.template.Template; public class Home extends Element { public void processElement() { ApplicationContext ctx = new FileSystemXmlApplicationContext("c:/DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml"); Version v = (Version) ctx.getBean("appVersionTarget", Version.class); System.out.println("[com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class name: "+v.getClass().getName()); Template template = getHtmlTemplate("pub.home"); print(template); } } with applicationContext2.xml: "http://www.springframework.org/dtd/spring-beans.dtd";> ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Cool :-) On 10-nov-05, at 09:00, Raoul Pierre wrote: Geert, I wrote a fix for it, you can download a RIFE snapshot from here: http://rifers.org/downloads/rife/snapshots/ Tell me if it works? It's ok now. Thanks. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Geert, I wrote a fix for it, you can download a RIFE snapshot from here: http://rifers.org/downloads/rife/snapshots/ Tell me if it works? It's ok now. Thanks. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Hi Pierre, you're right, sorry about that. I wrote a fix for it, you can download a RIFE snapshot from here: http://rifers.org/downloads/rife/snapshots/ Tell me if it works? Best regards, Geert On 9-nov-05, at 22:55, Raoul Pierre wrote: Geert, afaik this is overridden in ParticipantSpringWeb with this line: context.setAttribute(ContextLoader.CONFIG_LOCATION_PARAM, getParameter ()); This instruction adds a ContextLoader.CONFIG_LOCATION_PARAM item to the attribute list, not to the InitParameter one. And the context provided by (ServletContext)getRepository().getContext() doesn't give a adder to this last list. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Geert, afaik this is overridden in ParticipantSpringWeb with this line: context.setAttribute(ContextLoader.CONFIG_LOCATION_PARAM, getParameter ()); This instruction adds a ContextLoader.CONFIG_LOCATION_PARAM item to the attribute list, not to the InitParameter one. And the context provided by (ServletContext)getRepository().getContext() doesn't give a adder to this last list. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Hi Pierre, afaik this is overridden in ParticipantSpringWeb with this line: context.setAttribute(ContextLoader.CONFIG_LOCATION_PARAM, getParameter ()); I am no Spring expert though, so I might be totally misinterpreting things. Best regards, Geert I think that is normal behavior, everything in this class is simply delegated to Spring. I updated the text to be a bit more precise about it. For more info, just look at the source code: https://svn.rifers.org/rife/trunk/src/framework/com/uwyn/rife/rep/ participants/ParticipantSpringWeb.java In ParticipantSpringWeb, the value of ParticipantSpringWeb is used to set an attribute. But in ContextLoader.createWebApplicationContext there is: String configLocation = servletContext.getInitParameter (CONFIG_LOCATION_PARAM); and so the ParticipantSpringWeb value is not get here to set configLocation. So it's always the default location which is used (/WEB-INF/ applicationContext.xml) Did I miss something? Pierre -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Geert, I think that is normal behavior, everything in this class is simply delegated to Spring. I updated the text to be a bit more precise about it. For more info, just look at the source code: https://svn.rifers.org/rife/trunk/src/framework/com/uwyn/rife/rep/ participants/ParticipantSpringWeb.java In ParticipantSpringWeb, the value of ParticipantSpringWeb is used to set an attribute. But in ContextLoader.createWebApplicationContext there is: String configLocation = servletContext.getInitParameter(CONFIG_LOCATION_PARAM); and so the ParticipantSpringWeb value is not get here to set configLocation. So it's always the default location which is used (/WEB-INF/applicationContext.xml) Did I miss something? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Hi Pierre, I think that is normal behavior, everything in this class is simply delegated to Spring. I updated the text to be a bit more precise about it. For more info, just look at the source code: https://svn.rifers.org/rife/trunk/src/framework/com/uwyn/rife/rep/ participants/ParticipantSpringWeb.java Best regards, Geert On 9-nov-05, at 01:21, Raoul Pierre wrote: Hello, I tried to specify a spring context as explained in http:// rifers.org/wiki/display/RIFE/Spring+integration I put in rep/participants.xml ParticipantSpringWebparticipant> and I created the spring context file as stated above. But spring didn't find it. I had to copy it in WEB-INF. What did I miss? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba "Use what you need" Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] spring application context
Hello, I tried to specify a spring context as explained in http://rifers.org/wiki/display/RIFE/Spring+integration I put in rep/participants.xml param="rep/springcontext.xml">ParticipantSpringWeb and I created the spring context file as stated above. But spring didn't find it. I had to copy it in WEB-INF. What did I miss? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users