[coldbox 3.5.3] thow on exception for wirebox

If the DSL builder cannot find a dependency, it throws an error like this:

The DSL Definition {JAVACAST={null},NAME={service},ARGNAME={},DSL={model:pendingCaseService@Case},REQUIRED={false},SCOPE={variables},VALUE={null},REF={null}} did not produce any resulting dependency
The target requesting the dependency is: ‘pendingCaseService’

Is there a way to not throw that error if the dependency cannot be injected? This service layer is used in two places. One of does not use this dependency.

You must make the dependency as optional then

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions

Where is that option? I cannot find it in the docs.

How are you mapping them?

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions

Using the binder in WireBox.cfc:

this.map(“pendingCaseService”).to(“API.model.wrapper.case.pending.pendingService”).asSingleton();

Well with that you are letting wirebox auto wire everything. If you need more granular control you must say auto wire false and via the binder add the dependencies.

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions

I am using noAutorWire() now to be more granular and am getting an error when trying to inject a utility into the service.

in wirebox.cfc:

this.map(“caseBuildService”).to(“API.model.wrapper.case.build.buildService”).asSingleton().noAutoWire().setter(name=“utilities”,value=getColdbox().getPlugin(“utilities”));

i get this error:

The mappingExists method was not found.
Either there are no methods with the specified method name and argument types or the mappingExists method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.

The error occurred in C:/inetpub/www/Frameworks/coldbox_3_5_3/system/web/services/PluginService.cfc: line 119
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/web/services/PluginService.cfc: line 153
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/web/Controller.cfc: line 371
Called from C:/inetpub/www/Applications/Relax/config/WireBox.cfc: line 25
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/ioc/Injector.cfc: line 975
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/ioc/Injector.cfc: line 123
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/ioc/Injector.cfc: line 92
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/web/services/LoaderService.cfc: line 175
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/web/services/LoaderService.cfc: line 78
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/Coldbox.cfc: line 71
Called from C:/inetpub/www/Frameworks/coldbox_3_5_3/system/Coldbox.cfc: line 102
Called from C:/inetpub/www/Applications/Relax/Application.cfc: line 50

117 :
118 : // Check if plugin mapped?
119 : if( NOT wirebox.getBinder().mappingExists( pluginLocation ) ){
120 : // lazy load checks for wirebox
121 : wireboxSetup();

I am using the relax module.