[CB 4.0][CBORM 1.0] injecting Entity service from module

All,

I’m in a module trying to inject a entityService (using property name=“personService” inject=“entityService:Person”) into a handler (in the module) but I’m getting the error “A CFC with entityname Person could not be found.” I know that the entity is there, and correct. I’m not sure what I’m missing. Does someone know of any good samples with DI in the module handlers that I can look at. I know it’s something simple. It’s working fine in the application itself, just the module(s) have the problem.

I’m assuming ORM settings, etc are inherited from the parent app?

Thx

Do you have your modules folder in the CFC scan locations in your Application.cfc? Yes, the entire application uses the same ORM settings.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

Do you mean the scan locations in Wirebox.cfc? If so, I do not. To make things a hair more difficult, my models are external to the application. Does the autoMapModels have any effect on entities?

If the answer to the last is “no” then I should simply have to add my external modules “models” directory to the scan locations, correct?

Thanks for your help.

Scott

No, sorry, I mean the stock ColdFusion ORM setting that you put in Application.cfc that tells CF where to scan for ORM entities. I guess I shouldn’t have used the word ‘scan’.

this.ormsettings.cfclocation

Specifies the directory (or array of directories) that should be used by ColdFusion to search for persistent CFCs to generate the mapping. If is set, ColdFusion looks at only the paths specified in it. If it is not set, ColdFusion looks at the application directory, its sub-directories, and its mapped directories to search for persistent CFCs.

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSED380324-6CBE-47cb-9E5E-26B66ACA9E81.html

If you’re using the ColdBox ORM services, I don’t think any of the WireBox stuff matters. Do make sure you’ve set up your event listener though.

eventHandler=“cborm.models.EventHandler”

https://github.com/ColdBox/coldbox-samples/blob/master/applications/ormexample/Application.cfc#L29

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Brad,

You got it. I didn’t add the external modules path to the cfclocation. All is working as it should now. I did have the event listener setup though.

Thanks!

Scott