Coldbox 3.5.2 - models / services not found

Hi guys,

I recently setup a new CB app and am running under the latest stable version of Railo on OSX.

ORM is enabled and it is set to use my model folder for the CFC locations. I also have set a scan location in Wirebox:

scanLocations = [‘model’],

In my BaseHandler I have a few things injected:

property name=“ORMService” inject=“coldbox:plugin:ORMService”;
property name=“sessionService” inject=‘coldbox:plugin:SessionStorage’;
property name=“renderer” inject=‘coldbox:plugin:Renderer’;
property name=“PartnerService” inject;

When I try to reference PartnerService I get an error saying that it is undefined, whereas if I try to reference a renderer or sessionService, it works correctly. It seems like the app is not picking up my Services (despite them existing in the model folder).

Any ideas why this might be happening?

Thanks.

Nolan

Can you try with dot notation?

scanLocations = [‘com.model.yourservice’]

Just curious.

/OD

Hi Oguz,

That didn’t have any effect. I should also note that when running the app I’m running it through: localhost:8080 using the CloudBees SDK - http://www.cloudbees.com/ I"m not sure if this has anything to do with it.

It appears that CB is not picking up any of my custom services within the model folder.

Thanks.

Nolan

It sounds more caching issue to me.

Somehow CB could not reinitialize the app and checks for first loaded folder/files.

Have you tried the files at your local?

/OD

Hi Oguz,

I am running the app locally and have been able to reinit the app without issue. As soon as I add code that references PartnerService it blows an error saying that PartnerService is undefined, so it appears that it’s not being injected or picked up in the DI scan locations.

Nolan

Hi guys,

does anyone have any thoughts on this one? It has me stumped and i’m literally at a stand still until I can get past this error. Many thanks.

Nolan

Is there a method I can call to dump out what has been loaded through DI?

Thx.

N

Is PartnerService in the root of the models folder? If the actual file is in model.com.foo then you would need to inject com.foo.PartnerService.

Also, what happens when you try getModel(“PartnerService”)? That should tell you if WireBox is confgured correctly to find it.

~Brad

Also, make sure you reinit too after adding the DI annotations. WireBox caches metadata, if if the object being injected into is a transient.

Thanks!

~Brad

Hi Brad,

PartnerService is within the root of the model folder and I have done a reinit. If I use getModel() I can dump out the component, however if just try and dump out PartnerService (from DI) it’s undefined. Any ideas?

Thanks for your help.

Nolan