Hi Guys,

I've got it working! :-D

@Chris - I don't have any specific need for the ormService outside of MG. I 
don't actually use a parent bean factory for the sake of accessing outside 
MG really. It's all to do with ColdSpring remote proxies that we use for a 
couple of webservices. They get spawned in their own bean factory rather 
than the MG one so weren't reinited when the MG was which was a pain. So I 
abstracted things out into a parent factory which does get reinited at the 
same time as the MG app. Long story.

Anyway, the crux of the problem is that I was initing my own coldspring file 
in onAppStart which contained the ormService alias, rather than the simple 
one which didn't. After switching that around and having my parent bean 
factory only contain the MG config and nothing else, I then have MG spring 
the other beans.

I'm sure I made a real meal of explaining that.

   <!--- Get the environment specific configuration settings. --->

<cfset application.config = createObject("component", 
"model.environment.environment").init("/config/environment/environment.xml").getEnvironmentByURL(CGI.Server_Name)
 
/>  

  <!--- Instantiate the Bean Factory. A dynamic one for the environment 
specific stuff. --->

<cfset application.beanfactory = createObject("component", 
"coldspring.beans.DefaultXmlBeanFactory").init(defaultProperties=application.config)
 
/>

  <!--- Load ColdSpring beans & set bean factory into the application scope, 
using our environment specific settings. --->

<cfset application.beanfactory.loadBeansFromXmlFile(
"/config/coldspring/modelglue.xml") />


And then inside my index.cfm:


   <cfset ModelGlue_LOCAL_COLDSPRING_PATH = expandPath(".") & 
"/config/coldspring/beans.xml" />

<cfset ModelGlue_LOCAL_COLDSPRING_DEFAULT_PROPERTIES = application.config />

<cfset ModelGlue_PARENT_BEAN_FACTORY = application.beanfactory /> 


This works perfectly, the app inits without error, loads the orm service 
perfectly and also uses the environment specific variables.


Thanks so much guys, really appreciate the input.


Robert

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" 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/model-glue?hl=en

Reply via email to