RE: [coldbox:16145] Structuring the Model in ColdBox

Everything you have there looks correct. Since the default scan location is “models”, what happens if you temporarily change your property to inject=“user.UserService” (which would work without the mapDirectory())

If WireBox isn’t even picking that up, it may be because your models directory isn’t reachable by ColdBox. Is it in the root of your web root OR does it have a CF mapping to it? Basically, if you were to test a vanilla createObject call, would createObject(“component”,“models.User.UserService”) resolve?

Scan locations (implicit mappings) don’t create the mappings until you ask for them the first time, explicit mappings such as mapDirectory() creates them up front. To take a peek at the mappings that WireBox has created, try some code like this:

That will tell you whether or not WireBox is picking up your CFCs. If not, we can troubleshoot the mapping angle. If the mappings exist in the WireBox binder, we can trouble shoot your autowiring.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform: