I am working on a legacy application on which we have recently introduced ColdBox. In the onApplicationStart of onapplication.cfc we have the following code:
application.cbBootstrap = CreateObject("component","coldbox.system.Coldbox").init(this.cbSettings.COLDBOX_CONFIG_FILE, this.cbSettings.COLDBOX_APP_ROOT_PATH, this.cbSettings.COLDBOX_APP_KEY, this.cbSettings.COLDBOX_APP_MAPPING); application.cbBootstrap.loadColdbox(); application.wbInjector = createObject("component","coldbox.system.ioc.Injector").init("intranet.sqbox.config.WireBox");
The last line of which creates a global injector that is used in our legacy code to get access to objects managed by the IOC container. Everything has been working great until I attempted to inject the ORMService plugin into a repository component:
property name="ORMService" inject="coldbox:plugin:ORMService";
The component that contains this is injected into other components where necessary. For the most part this works fine, except for cases where the wbInjector from above is utilized in legacy code to get access to an object that has the repository in question injected into it. That code looks like this:
<cfset searchService = application.wbInjector.getInstance("RailoSearchService")>
The RailoSearchService gets the repository in question injected into its constructor. In this case I get the error in the subject of this post.
Any ideas what I am doing wrong?
Thanks.