[Coldbox 3.6 - Wirebox] - ERROR DSL Definition: did not produce any resulting dependency

I’m trying to use Wirebox to inject an object into one of my handlers and I keep getting the subject error. Here is my property definition in the handler:

property name=“awardService” inject;

Here is the the full text of the Error message:

“ERROR”,“ROLLINGFILE”,“06/20/2013”,“09:17:36”,“coldbox.system.ioc.Builder”,“Target: application.handlers.ehAward -> DSL Definition: {JAVACAST={null},NAME={awardService},ARGNAME={},DSL={id:awardService},REQUIRED={false},SCOPE={variables},VALUE={null},REF={null}} did not produce any resulting dependency”

Here is my Wirebox.cfc:

component extends=“coldbox.system.ioc.config.Binder”
hint=“WireBox Binder configuration object” output=“false”
{
public void function configure()
output=“false”
{
wireBox = {
// Scope registration, automatically register a wirebox injector instance on any CF scope
// By default it registeres itself on application scope
scopeRegistration = {
enabled = true,
scope = “application”, // server, cluster, session, application
key = “wireBox”
},

// DSL Namespace registrations
customDSL = {
// namespace = “mapping name”
},

// Custom Storage Scopes
customScopes = {
// annotationName = “mapping name”
},

// Package scan locations
scanLocations = [],

// Stop Recursions
stopRecursions = [],

// Parent Injector to assign to the configured injector, this must be an object reference
parentInjector = “”,

// Register all event listeners here, they are created in the specified order
listeners = [
// { class="", name="", properties={} }
]
};

map(“awardService”).to(“BaseCFC.award.Award”).initArg(name=“coldbox”,value=getColdBox());
}

}

I tried things like taking out the init args in the cfc and the mapping, putting “id:awardService” in the property, etc. But I always get that error. Any help appreciated.

Jim

Wirebox is having a problem creating the awardService. Can you show the relevant code in that object.

Thanks,
Curt Gratz
Computer Know How

For testing, you can just place the code <cfdump var="#getModel(“awardService”)#"> in a handler/view.

Try turning on debug logging for coldbox.system.ioc. Also, can you confirm that your WireBox binder config is getting called?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Thanks for the reply. I put it into debug mode and the only reference I see to awardservice is:

“DEBUG”,“ROLLINGFILE”,“06/20/2013”,“10:51:00”,“coldbox.system.ioc.Injector”,“Instance: awardService was not located anywhere”

When I run it through the Coldfusion debugger I put a breakpoint on the map().to() statement in the wirebox.cfc config and it does stop there. To me it just seems as if wirebox is not even trying to create the awardService. So I guess I’m just missing something. The top of the awardService object looks like this:

component output=“false” singleton
{
public any function init(any coldbox)
{
return this;
}

I tried with and without the init.

Thanks.

Put the following code in a view somewhere and run it after the framework boots

#arrayToList(mappingStruct[mapping].getAlias())# maps to #mappingStruct[mapping].getpath()#

It should show you the mappings that are registered. Confirm everything is correct.

Also, does createObject(“component”,“BaseCFC.award.Award”) work?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

The createObject works. The code you have below produces:

maps to D:\application\aro\extranet\user\UserGateway.cfc
maps to coldbox.system.plugins.JVMUtils
maps to application.handlers.ehAward
maps to coldbox.system.validation.ValidationManager
maps to coldbox.system.plugins.IOC
maps to coldbox.system.plugins.logger
maps to application.handlers.ehCAC
maps to coldbox.system.plugins.HTMLHelper
maps to coldbox.system.plugins.BeanFactory
maps to application.handlers.ehGeneral
maps to coldbox.system.plugins.ResourceBundle
maps to coldbox.system.Plugin
maps to coldbox.system.plugins.SessionStorage
maps to coldbox.system.plugins.Renderer
maps to D:\application\aro\extranet\utilities\ServerGateway.cfc
maps to coldbox.system.EventHandler

Which seems to suggest the wirebox.cfc configuration file I have is not being called for some reason. I have a coldbox.cfc which contains the following:
ioc = {
framework = “wirebox”,
reload = true,
objectCaching = false,
definitionFile = “application.config.Wirebox”
};

wirebox = {
enabled = true
};

Then the configuration for the application inherits from the coldbox.cfc. The application config cfc only has a few custom settings for the application. Any ideas?

I have

Jim,

I could be wrong here, but this line seems wrong.

property name=“awardService” inject;

My understanding is that the above will try to find the cfc in the current directory, what you should or actually need to do is reference it by its name.

property name=“awardService” inject=“awardService”;

Hmm, can you share a bit more about how your config files are set up? Are you calling super.configure()?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

That line is fine as long as he is on Adobe CF. (Railo doesn’t like that syntax yet).

If inject has no value, it defaults to the name attribute and the default namespace is the “id”.

From the output of his dumped code, there is not a mapping called “awardService” which is most likely the issue.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Yes, I have 3 functions in the child config cfc, development which calls super.development() at the top, production which calls super.production() at the top, and configure which calls super.configure() at the top. Thanks.

Jim

Thanks, but I did try that both as inject=“awardService” and inject=“id:awardService”. Reading the wiki, it looked to me as if wirebox would use the name of the property as the alias to look up the mapping.

Any way you can post both components? Make sure you are not overwriting structs either.

What happens if you just simplify the app for a bit and try a single, simple binder config?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Ok, I create a super simple application and I still have the same issue. Below are the relevant files. I can’t attach since it is blocked at our firewall. Thanks.

--------------------------------------------- COLDBOX CONFIG ------------------------------------------------------------

component
{
void function configure()
{
coldbox =
{
AppName =“Simple”,
AppMapping =“application”,
DebugMode =false,
DebugPassword ="",
EventName =“event”,
DefaultEvent =“ehSimple.start”,
RequestStartHandler ="",
RequestEndHandler ="",
SessionStartHandler ="",
SessionEndHandler ="",
UDFLibraryFile ="",
CustomErrorTemplate ="",
HandlersIndexAutoReload =true,
ConfigAutoReload =true,
ExceptionHandler ="",
onInvalidEvent ="",
HandlerCaching =false,
RequestContextDecorator ="",
ProxyReturnCollection =false
};

ioc = {
framework = “wirebox”,
objectCaching = false,
definitionFile = “application.config.SimpleWirebox”
};

wirebox = {
enabled = true
};

}
}

--------------------------------------------------------------- WIREBOX BINDER --------------------------------------------------------------

component extends=“coldbox.system.ioc.config.Binder”
hint=“WireBox Binder configuration object” output=“false”
{
public void function configure()
output=“false”
{
wireBox = {
// Scope registration, automatically register a wirebox injector instance on any CF scope
// By default it registeres itself on application scope
scopeRegistration = {
enabled = true,
scope = “application”, // server, cluster, session, application
key = “wireBox”
},

// DSL Namespace registrations
customDSL = {
// namespace = “mapping name”
},

// Custom Storage Scopes
customScopes = {
// annotationName = “mapping name”
},

// Package scan locations
scanLocations = [],

// Stop Recursions
stopRecursions = [],

// Parent Injector to assign to the configured injector, this must be an object reference
parentInjector = “”,

// Register all event listeners here, they are created in the specified order
listeners = [
// { class="", name="", properties={} }
]
};

map(“simpleService”).to(“application.aro.extranet.Simple”);
}

}

------------------------------------------------------------------- Application.cfc -----------------------------------------------------

<!-----------------------------------------------------------------------

Is your simple service located here:

/application/aro/extranet/Simple.cfc

OR

You have a mapping defined for “application”?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Ok, in your config file, remove all the existing ioc and wirebox stuff and replace it with this:

wirebox = {
binder = “application.config.SimpleWirebox”
};

You only need the ioc struct if you are going to interface with an external ioc engine. The WireBox IOC adapter was creating a second instance of WireBox with the same scope registration that was overwriting the original one in memory and that is why the mapping for simpleService was disappearing.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

I have a mapping defined for application. All that is under the web root is the application.cfc and index.cfc which is essentially empty. Thanks.

Yep, that seemed to do it. It makes sense now, but I never would have known that one was overwriting the other. Thanks for your help! Jim