Problem with Autowiring

Hi. I am having some trouble trying to implement autowiring and hoped
someone could help.

I have a abstractHandler which all my other handlers will inherit from
and within this handler I have two properties.

component autowire="true" {
    property name="someObject" inject="model:myObject";
    property name="mySecondObject" inject="model";

    public abstractHandler function init() {
        return this;
    }
}

With my models defined:

component displayname="myObject" accessors="true" singleton {
    property name="someSetting" type="string"
inject="coldbox:setting:someSetting";
...

<cfcomponent displayname="mySecondObject" accessors="true" singleton>
...

Now from my understanding of autowiring, that should work. However I
get the error:

Error autowiring handlers.Main. The DSL Definition
{JAVACAST={null},NAME={someObject},DSL={model:myObject},REQUIRED={false},SCOPE={variables},VALUE={null},REF={null}}
did not produce any resulting dependency The target requesting the
dependency is: 'handlers.Main'

It seems the injection in my models is fine because if I remove the
properties in the abstractHandler and in the init function add:

someObject = application.wirebox.getInstance("models.myObject");
mySecondObject =
application.wirebox.getInstance("models.mySecondObject");

everything works fine. My Wirebox.cfc is the same as when I downloaded
and my config is defined:

wireBox = {
    enabled = true,
    singletonReload = true
};

interceptors = [
    {class="coldbox.system.interceptors.Autowire",
properties={ debugMode=true }}
];

Does anyone have any ideas as to what I am doing wrong here?

Can you post the handler target

Luis Majano
President
Ortus Solutions, Corp
Toll free phone/fax: 1-888-557-8057
Mobile: 909-248-3408

www.coldbox.org

Sure.
component extends="abstractHandler" {
        public main function init() {
                super.init();
                return this;
        }
        public void function onRequestStart(any event) {
                request.someObject = someObject;
                request.mySecondObject= mySecondObject;
        }
}

I have something similar in lots of places, did you reinit the fw. Also, why are you using “request” scope?

Luis F. Majano
President
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yes I have reinitialised the fw. The idea is have a reference to the
object in the request scope so I can easily use the methods across the
site (for example a helper object). I suppose I could use a plugin.

I really can't see what I am doing wrong! I have uploaded the simple
example above to my dropbox. Would you mind taking a look to see if I
done something obviously wrong? http://dl.dropbox.com/u/23788424/testapp.rar

Ok - so I have solved my issue. Embarrassingly my model directory was
models and I hadn't added the convention to the config. Woops.