Sorry that it took me while to reply to this, it slipped down my inbox.

The easiest way to solve this is to actually modify the
AutowiringParticipantSpringWeb so that it is able to provide you with
the instance of DatabaseDataGenerator that you need. Then, instead of
injecting it into your own blocking participant, you get is from the
spring participant. If you make the spring participant blocking, then
your participant will only retrieve the instance once the spring
participant is finished initializing.

Hope this helps.

On 6/13/07, Mork0075 <[EMAIL PROTECTED]> wrote:
>
> We've got an spring applicationContext. We supply it to rife in the
> participants.xml as a parameter for the AutowiringParticipantSpringWeb
> (implemented like the wiki suggest it). After this theres an entry in
> the participants.xml which describes an blocking participant.
>
> The blocking participant got an attribute of the type
> DatabaseDataGenerator (which i would like to be set by spring) and it
> calls  the method databaseDataGenerator.init()
>
> The DatabaseDataGenerator itself has an attribute GenericDAO, which also
> needs to be set by spring.
>
> The problem is, that there is a NullPointerException while the blocking
> participant calls databaseDataGenerator.init() because
> databaseDataGenerator wasnt set by spring.
>
>
>
> Geert Bevin schrieb:
> > Is the problem that your custom participant starts up after the spring
> > participant is finished, or do you have a problem accessing the data
> > of the spring participant?
> >
> > On 6/13/07, Mork0075 <[EMAIL PROTECTED]> wrote:
> >
> >> Hello Geert,
> >>
> >> now theres another, similar problem.
> >>
> >> We set our DAO (hibernate persistence) references with spring. This
> >> works now fine for elements. But i also implemented a blocking
> >> participant, which initialises the database on startup, which means
> >> during development i push some sample data to the database every time
> >> rife starts up.
> >>
> >> The problem now is, that the in spring registered bean isnt set in the
> >> blocking participant. (the access fails with null pointer)
> >>
> >> Because now rife handles the applicationContext, i also could not call
> >> spring directly, because then there would be two instances.
> >>
> >> Have you any suggestions how to add IoC to rifes blocking participants?
> >>
> >> Thanks a lot :)
> >>
> >>
> >> Geert Bevin schrieb:
> >>
> >>> Hi, glad you figured it out and sorry I didn't respond earlier. RIFE
> >>> just passes this on to
> >>> WebApplicationContextUtils.getWebApplicationContext and set the
> >>> ContextLoader.CONFIG_LOCATION_PARAM with the value you provide.
> >>>
> >>> Best regards,
> >>>
> >>> Geert
> >>>
> >>> On 6/11/07, Mork0075 <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>>> Ok, it looks like i solved it. My location of the context is
> >>>> 'config/spring/applicationConfig.xml' where config is a source folder.
> >>>> So the correct path is 'spring/applicationConfig.xml'
> >>>>
> >>>> Mork schrieb:
> >>>>
> >>>>
> >>>>> Another question is: Spring supports the ApplicationContext being set 
> >>>>> either
> >>>>> by xml file or programmatically via a Java class. Is the second one also
> >>>>> supported by rife?
> >>>>>
> >>>>> Mork wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Hello,
> >>>>>>
> >>>>>> i would like to use the spring integration of rife. I use the
> >>>>>> AutowiringParticipantSpringWeb class from the wiki. The problem is, 
> >>>>>> that
> >>>>>> my applicationContext xml is not found:
> >>>>>>
> >>>>>> <participant param="config/spring/applicationConfig.xml"> causes a
> >>>>>> FileNotFoundException although this is the correct path (the
> >>>>>> applicationContext is named applicationConfig.xml). Also the leading
> >>>>>> "classpath:config.." doenst help.
> >>>>>>
> >>>>>> Any ideas?
> >>>>>>
> >>>>>> Thanks a lot
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>
> >>>
> >>
> >
> >
> >
>
>
> >
>


-- 
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to