error injecting coldbox:plugin:{pluginName}

Hey guys, I’m having trouble trying to inject any of the core coldbox plugins into one of my mapped services via wirebox - hope someone here can help set me onward.

Here is the relevant portion of my binder:

component extends=“coldbox.system.ioc.config.Binder” output=“false”
{
function configure(){
map(“RenderingTemplates”).toValue({
forms=“cb3HTMLHelper”, // “default,cfuniform”
grids=“default”,
lists=“default”,
menus=“default”
});
map(“RenderingOptions”).toValue({
enabled=true,
regenerate=true
});

map(“Factory1”).to(“org.xyz.model.factories.Factory1”);
map(“Service1”).to(“org.xyz.model.services.Service1”);
map(“Service2”).to(“org.xyz.model.services.Service2”);

map(“HTMLHelper”).toDSL(“coldbox:plugin:HTMLHelper”); //.chaining .asEagerInit() +| .asSingleton() didn’t help :{
map(“RenderingService”).to(“org.xyz.model.services.RenderingService”); //see above comment
map(“XYZ”).to(“org.xyz.XYZ”).inCacheBox().;

}
}

Here is the relevant meta for my RenderingService cfc

<!— doesn’t error out, but doesn’t help me out either :frowning: —>

… public & private methods …

if you need any more details then this let me know…

Anyways, I get a similar error and stack trace as show below with any combination of what i’ve doing to inject with wirebox elsewhere, this problem seems to only happen for me when i try to inject a coldbox:plugin dsl ID.

btw, I’m currently working on the latest dev branch from git, but I think I first noticed the issue last week…

Can anyone confirm this error, or am I just doing something wrong here?

Error Occurred While Processing Request

Element CACHE.PLUGIN_CACHEKEY_PREFIX is undefined in INSTANCE.

The error occurred in D:\source\fws\coldbox-platform\system\web\services\PluginService.cfc: line 368
Called from D:\source\fws\coldbox-platform\system\web\services\PluginService.cfc: line 140
Called from D:\source\fws\coldbox-platform\system\web\Controller.cfc: line 325
Called from D:\source\fws\coldbox-platform\system\ioc\dsl\ColdBoxDSL.cfc: line 156
Called from D:\source\fws\coldbox-platform\system\ioc\dsl\ColdBoxDSL.cfc: line 42
Called from D:\source\fws\coldbox-platform\system\ioc\Builder.cfc: line 309
Called from D:\source\fws\coldbox-platform\system\ioc\Builder.cfc: line 281
Called from D:\source\fws\coldbox-platform\system\ioc\Injector.cfc: line 300
Called from D:\source\fws\coldbox-platform\system\ioc\scopes\NoScope.cfc: line 31
Called from D:\source\fws\coldbox-platform\system\ioc\Injector.cfc: line 259
Called from D:\source\fws\coldbox-platform\system\ioc\config\Binder.cfc: line 796
Called from D:\source\fws\coldbox-platform\system\ioc\Injector.cfc: line 156
Called from D:\source\fws\coldbox-platform\system\ioc\Injector.cfc: line 90
Called from D:\source\fws\coldbox-platform\system\web\services\LoaderService.cfc: line 159
Called from D:\source\fws\coldbox-platform\system\web\services\LoaderService.cfc: line 77
Called from D:\source\fws\coldbox-platform\system\Coldbox.cfc: line 71
Called from D:\source\fws\coldbox-platform\system\Coldbox.cfc: line 102
Called from D:\source\org\XYZ\Application.cfc: line 71

366 : 		
367 : 		<cfscript>
**368 : 			var pluginKey = instance.cache.PLUGIN_CACHEKEY_PREFIX & arguments.plugin;**
369 : 			
370 : 			// A module Plugin

Adam I think this was a registered bug. Can you try from the development branch and let me know.

Luis Majano
President
Ortus Solutions, Corp
Toll free phone/fax: 1-888-557-8057
Mobile: 909-248-3408
www.ortussolutions.com
www.coldbox.org

Luis,

Thanks… I’ve been running from development for at least two weeks now… but I only just tried injecting a plugin.

-a

Ok, when was the last update you did from development branch?
I am assuming you are using coldbox also right?

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

Luis,

I have keeped my local dev branch synced to gihubt after all changes to dev last week… including friday, and saturday and yes, I am using cachebox and wirebox in my coldbox app without a hitch elsewhere (so far).

I have been able get around the issue of dsl injecting a plugin by using inject=“coldbox” into my service and then using getColdbox().getPluginService().get(plugin=“name”,custom=false) in my service… but i was hoping to avoid having to inject coldbox into this service, since i really just want to get at a plugin.

I find it weird that injecting coldbox and then using the getPlugin() or getPluginService().get() works, but not the coldbox:plugin:{name} dsl… shouldn’t these be equivalent?

Best regards,
Adam

Ok, I cannot get this to error out.

here is what I did:

Binder:

map(“HTMLHelper”).toDSL(“coldbox:plugin:HTMLHelper”);

TestService.cfc

component singleton=“true” accessors=“true”{

property name=“HTMLHelper” inject;

TestService function init(){

return this;

}

}

Then I request the TestService and all dependencies are there. Is there something I am missing?

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