RE: [coldbox:17866] Re: [coldbox 3.5.3] Referencing datasource bean in wirebox config.cfc

Are you using Wirebox inside of a Coldbox application? cfdump getProperties() and see what’s in there. Can you also show us your 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

Thanks in advance…dumping getProperties() inside the wirebox.cfc returns an empty struct. CBX config.cfc:

component output=“false” hint=“My App Configuration”
{
// Configure ColdBox Application
function configure(){

// coldbox directives
coldbox = {
//Application Setup
appName = “ABC”,
eventName = “event”,

//Development Settings
debugMode = false,
debugPassword = “”,
reinitPassword = “”,
handlersIndexAutoReload = false,

//Implicit Events
defaultEvent = “General.index”,
requestStartHandler = “Main.onRequestStart”,
requestEndHandler = “”,
applicationStartHandler = “Main.onAppInit”,
applicationEndHandler = “”,
sessionStartHandler = “”,
sessionEndHandler = “”,
missingTemplateHandler = “”,

//Extension Points
UDFLibraryFile = “includes/helpers/ApplicationHelper.cfm”,
coldboxExtensionsLocation = “”,
modulesExternalLocation = [],
pluginsExternalLocation = “”,
viewsExternalLocation = “”,
layoutsExternalLocation = “”,
handlersExternalLocation = “”,
requestContextDecorator = “”,

//Error/Exception Handling
exceptionHandler = “”,
onInvalidEvent = “”,
customErrorTemplate = “”,

//Application Aspects
handlerCaching = true,
eventCaching = true,
proxyReturnCollection = false,
flashURLPersistScope = “session”
};

// custom settings
settings = {
rbPath = “/config/hyrule”,
fileSystemPath = getDirectoryFromPath(getBaseTemplatePath())
};

// environment settings, create a detectEnvironment() method to detect it yourself.
// create a function with the name of the environment so it can be executed if that environment is detected
// the value of the environment is a list of regex patterns to match the cgi.http_host.
environments = {
local = “^local.”,
development = “^dev.”,
test = “^test.”
};

// Module Directives
modules = {
//Turn to false in production
autoReload = false,
// An array of modules names to load, empty means all of them
include = [],
// An array of modules names to NOT load, empty means none
exclude = []
};

//LogBox DSL
logBox = {
// Define Appenders
appenders = {
coldboxTracer = { class=“coldbox.system.logging.appenders.ColdboxTracerAppender” },
myAsyncFile = {
class=“coldbox.system.logging.appenders.AsyncRollingFileAppender”,
properties = {
filePath=expandPath("/common/logs"),autoExpand=false
}
}

},
// Root Logger
root = { levelmax=“INFO”, appenders="*" },
// Implicit Level Categories
info = [ “coldbox.system” ],
debug = [“coldbox.system.ioc”]
};

//Layout Settings
layoutSettings = {
defaultLayout = “Layout.Main.cfm”,
defaultView = “”
};

//Interceptor Settings
interceptorSettings = {
throwOnInvalidStates = false,
customInterceptionPoints = “”
};

//Register interceptors as an array, we need order
interceptors = [
//SES
{class=“coldbox.system.interceptors.SES”,properties={}}/,
{class=“interceptors.Security”
,properties={
isAuthenticated=session.User.getIsAuthenticated()
}
},
{class=“coldbox.system.interceptors.Security”
,name=“ApplicationSecurity”
,properties={
rulesSource=“xml”,
rulesFile=“config/securityrules.xml”,
debugMode=true
}}
/
];

// Object & Form Validation
validation = {
// manager = “class path” or none at all to use ColdBox as the validation manager
// The shared constraints for your application.
sharedConstraints = {
// EX
// myForm = { name={required=true}, age={type=“numeric”,min=“18”} }
}
};

flash = {
scope = “session”
/properties = {},
inflateToRC = true,
inflateToPRC = false,
autoPurge = true,
autoSave = true
/
};
/*
//Mailsettings
mailSettings = {
server = “”,
username = “”,
password = “”,
port = 25
};

*/

//Datasources
datasources = {
primary= {name=“appprod”}
};
}

/**

  • Executed whenever the development environment is detected
    */
    function local()
    {
    coldbox.appName = “ABC - LOCAL”;
    //Development Settings
    coldbox.debugMode = true;
    coldbox.debugPassword = “”;
    coldbox.reinitPassword = “123456”;
    coldbox.handlersIndexAutoReload = true;
    coldbox.configAutoReload = true;

// Override coldbox directives
coldbox.handlerCaching = false;
coldbox.eventCaching = false;
coldbox.IOCObjectCaching = false;

datasources = {
primary = {name=“applocal”}
};

wirebox = {
singletonReload = true
};

//Debugger Settings
debugger = {
enableDumpVar = false,
persistentRequestProfilers = true,
maxPersistentRequestProfilers = 10,
maxRCPanelQueryRows = 50,
//Panels
showTracerPanel = true,
expandedTracerPanel = false,
showInfoPanel = true,
expandedInfoPanel = false,
showCachePanel = true,
expandedCachePanel = false,
showRCPanel = true,
expandedRCPanel = true,
showModulesPanel = true,
expandedModulesPanel = false
};
}
}

I am guessing I have something set incorrectly in the CBX config.cfc; I brought up a generic CBX site and I am able to return CBX properties in wirebox.cfc.