Colbox.cfc and Model injection

I'm updating my app to use Coldbox.cfc instead of the coldbox.xml file
and have run into an issue that I'm stumped on.

I have a security interceptor to make sure someone logs in before they
can access the application. The Event Handler that attempts the log in
uses Model Injection to inject a User Service class. When using the
coldbox.xml file this works fine, but if I try to use the Coldbox.cfc
for my settings I get an error that the UserService can not be found.

I'm injecting the UserService doing :
<cfproperty name="UserService" type="model" scope="instance" />

I then call it as instance.UserService.authenticate(user,pass)

If I switch back to the xml file, the UserService is called without an

Is there something in using the cfc that could be causing this?


Sorry, I should have included the actual error message.

Here is the error:
Element USERSERVICE is undefined in a Java object of type class

My thought is that your service is not being injected.

  1. Did you “reinit” your app?
  2. Is your autowire interceptor declared in Coldbox.cfc?
  3. Maybe try

<cfproperty name=“UserService” inject=“model” scope=“instance” />

  1. Or try to inject using an alternate form. like “model:UserService” or by creating a “UserService” mapping. See the docs for multiple ways.
  • Gabriel

I forgot to add the autowire interceptor in.

Thanks for pointing that out, I didn't even notice that I was missing