I am attempting to configure a wirebox injector object manually in Application.cfc so that some of our legacy code can access objects managed by the IOC container. However I am getting an error when I attempt to do this.
In my Application.cfc (onApplicationStart), I have:
`
87 application.cbBootstrap = CreateObject(“component”,“coldbox.system.Coldbox”).init(this.cbSettings.COLDBOX_CONFIG_FILE, 8 this.cbSettings.COLDBOX_APP_ROOT_PATH, this.cbSettings.COLDBOX_APP_KEY, this.cbSettings.COLDBOX_APP_MAPPING);
88 application.cbBootstrap.loadColdbox();
89 application.wbInjector = createObject(“component”,“coldbox.system.ioc.Injector”).init(binder=“intranet.sqbox.config.WireBox”, coldbox=application.cbBootstrap);
`
When this code runs I get the following error:
`
Oops! An error has occurred
Please provide the following information to technical support:
Error: component [coldbox.system.Coldbox] has no function with name [getLogBox]
Template: C:\inetpub\wwwroot\Version130Dev\coldbox\system\ioc\Injector.cfc
Detail:
Error on line: 113 in C:\inetpub\wwwroot\Version130Dev\coldbox\system\ioc\Injector.cfc
Error on line: 92 in C:\inetpub\wwwroot\Version130Dev\coldbox\system\ioc\Injector.cfc
Error on line: 89 in C:\inetpub\wwwroot\Version130Dev\Intranet\Application.cfc
Type: expression
`
Any ideas where I might be going wrong?
I do have logbox configured in the configure method of my Coldbox.cfc file and it seems to work fine:
`
logBox = {
appenders = {
// AsyncRollingFileAppender outputs to the C:\inetpub\logs\IC\APPLICATION.log file
application = {
class=“coldbox.system.logging.appenders.AsyncRollingFileAppender”,
levelMax=“DEBUG”,
levelMin=“FATAL”,
properties={
filePath=“C:\inetpub\logs\IC”,
autoExpand=“false”,
fileMaxSize=“3000”,
fileMaxArchives=“5”
}
}
},
root = { levelmax=“ERROR”, levelMin=“FATAL”, appenders="" },
categories = {
“intranet” = { levelmax=“DEBUG”, levelMin=“FATAL”, appenders="" },
“coldbox.system.orm” = { levelmax=“DEBUG”, levelMin=“FATAL”, appenders="" },
“_testcases” = { levelmax=“DEBUG”, levelMin=“FATAL”, appenders="" }
}
};
`