RE: Re: Re: Re: [coldbox:18105] [coldbox 3.5.3] referencing plugin in configure() in wirebox.cfc

Sorry, that’s not was I was asking. I wanted to see the actual code that called getUtilities() that you referenced two E-mails ago to help figure out the “Value must be initialized before use.” error you were receiving.

Have you also thought about not injecting at all, but for dependencies that might not exist (which at that point isn’t much of a “dependent”) injecting WireBox and asking it if the object exists, and if so retrieving it? Another option would be to use MockBox to create stubs for the non-existent objects, though I’m not entirely sure how your code is working around the dependencies that does exist in some cases since I assume your code still references them.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform:

Here is the method. Very simple.

public struct function getSample(required any wrapper){
var metadata = arguments.wrapper.getEntityMetaData();

var requestPackage = getRequestPackage();

var result = [];

var writePath = arguments.wrapper.getWritePath(type=“sample”,fullName=metadata.fullName & “_LIST”);


for(var x=1;x<=5;x++){



return {
format = “XML”,
description = “A XML sample response packet for a list of resources.”,
body = fileRead(writePath)

By design, cannot the binder inject plugins in configure() or is that a bug?

If I inject coldbox with iniArg(), I can then use getColdbox().getPlugin() in the class. Although, I would rather prefer a direct call to a plugin (or whatever else im injecting).