[coldbox-4.3.0] Help upgrading from 3.5

I’m trying to upgrade a couple applications that use 3.5. I’ve read upgrading page, and have installed the compatibility module. That resolved some of my errors. Now I’m getting an error from my ApplicationHelper.cfm file. This code at the top of the file:

<cfif NOT FindNoCase(‘interceptors’,getMetadata(this).fullName)>
<cfset sb = getController().getPlugin(‘ioc’).getBean(‘sessionBrokerService’) />
<cfset utility = getController().getPlugin(‘ioc’).getBean(‘BaseDelachauxComponent’) />
<cfset salesOrgService = getController().getPlugin(‘ioc’).getBean(‘salesOrgService’) />

Doesn’t work any more. I get

Error building: coldbox.system.EventHandler -> The method getInstance was not found in component C:/inetpub/wwwroot/coldbox/system/web/Controller.cfc. Ensure that the method is defined, and that it is spelled correctly. with constructor arguments: {controller={[(Component=coldbox.system.web.Controller)]}}

What is the proper way to be able to access my ColdSpring beans from the ApplicationHelper.cfm file? This file is my “UDFLibraryFile”, but I also see we are cfincluding it directly in some places, like in a Layout. In other places we are loading it with includeUDF().

I’m on CF10, and working on moving to CF2016. Thanks for your help.

-Ryan

The IOC plugin is now the CBIOC module
https://www.forgebox.io//view/cbioc

I would ask you if there is a reason to keep using ColdSpring at this point. It’s been dead for years and is superseded in about every way by WireBox, which has a native integration in ColdBox or as a standalone library.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

We have ModelGlue app that uses ColdSpring, and these two apps share the ColdSpring config file. The MG app is dependent on ColdSpring.

Thank you for that link, I installed the cbioc module, but I am still getting my original error. I think I gave the wrong error message before, that message was after I had tried some different syntax.

This code:
<cfset sb = getController().getPlugin(‘ioc’).getBean(‘sessionBrokerService’) />

Results in this error:

Error building: coldbox.system.EventHandler -> Variable GETCONTROLLER is undefined. with constructor arguments: {controller={[(Component=coldbox.system.web.Controller)]}}

I think I should be using some different syntax in 4.3?

I changed my code to just getBean, and now I think I’m past that and getting a different error. We don’t use LogBox, so I’m not sure where this is coming from… I’ll continue to dig.

Error building: coldbox.system.EventHandler -> Could not find the ColdFusion component or interface cachebox.system.cache.config.LogBox. Ensure that the name is correct and that the component or interface exists. with constructor arguments: {controller={[(Component=coldbox.system.web.Controller)]}}

You can’t just drop in the module and expect the old code to work. You’ll need to look at the readme to see how to call it. It’s very similar, but methods like getPlugin() don’t exist any longer in ColdBox 4. The compatibility module tries to add some of that back in, but it’s really better off just switching to the new syntax. As far as your specific errors, I don’t really know-- there’s just too much I’d need to see that I can’t see over E-mail to know what’s going on. I do know the code shown below is nothing like the new syntax. I would expect it to be something more like

getInstance( ‘ioc:beanID’ )

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

LogBox is inherently part of ColdBox (and even WireBox standalone and CacheBox standalone). I’d need to see the full stack trace to guess what’s going on below. The first thing that I notice that doesn’t look right is that the CFC path cachebox.system.cache.config.LogBox is in the cachebox.system package instead of coldbox.system. Are you trying to manually create WireBox or CacheBox?

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Yes, we do use CacheBox stand alone (both the MG app and the ColdBox app use it). So I have a CF mapping for /cachebox.

I’ll read up some more and keep trying to get this working.

I’m trying to get the Couchbase provider working, it seems a lot of documentation links are circular, they keep sending me to https://cachebox.ortusbooks.com/content/ and I can’t find much info there. It seems Coldbox & Cachebox don’t come with a Couchbase provider? Am I supposed to use this one from Github that’s 4 years old? GitHub - ColdBox/cachebox-couchbase: A CacheBox provider for Couchbase NoSQL (DEPRECATED) Use Link Instead

My old code:

ourcache = {
provider=“cachebox.couchbase.CouchbaseProvider”,
properties = {

}

Obviously cachebox.couchbase.CouchbaseProvider does not exist in the 4.x version, nor does coldbox.system.cache.providers.CouchbaseProvider. So I need to download something but I am not sure what…

I found a download for the Couchbase provider here: https://www.forgebox.io/view/Couchbase-Provider

But am now getting this error. Looks like the Couchbase provider expects there to be a javaloader supplied with ColdBox, but there is not?

HI Ryan, we wrote that in the ColdBox 3 days. I’m not sure if it’s been updated for ColdBox 4 (where java loader is a module). I did just check and there are commits on the dev branch that are not on master. Maybe you can help us update it. Also note, this uses the older version of the Couchbase Java SDK as well.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Ok. Are you saying people are not really using Couchbase with Cachebox anymore?

I haven’t used it in a while. Since all our hosting is on Lucee, we just use the Lucee extension now to create Lucee caches that connect directly to Couchbase and then the standard CF providers are fine.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com