[ColdBox SEEK 3.6.0] Application.cfc, inheritence style,

I have an application that uses the Application.cfc, inheritence style. It was developed on [server 1]. When I ported it to a test server [server 2] which has a similar file structure I encountered no problems. However, when I ported it to another test server [server 3] there is a problem because the application is now several directories further away from the webroot. Therefore I immediately encounter the error:

Could not find the ColdFusion component or interface coldbox.system.Coldbox

So I altered the tag from:

so that the Application.cfc extends correctly. However, this doesn’t work because now everything else fails inside the system.Coldbox.cfc itself:

Could not find the ColdFusion component or interface coldbox.system.web.Controller.

The error occurred in /ec/test/app/webroot/external/europa/COMM/commfrontoffice/coldbox/system/Coldbox.cfc: line 69

67 : }

68 : // Create Brand New Controller

69 : application[ appKey ] = CreateObject(“component”,“coldbox.system.web.Controller”).init( COLDBOX_APP_ROOT_PATH, appKey );

So, do I need to pass the ‘mapping’ of where the coldbox files reside on the server into the Coldbox.cfc itself?

Or should I re-instate the original tag and do something else??

All advice appreciated.

I tried inserting this in the Application.cfc

<cfset this.mappings[ “/coldbox” ] = “/path/from/webroot/to/coldbox” />

but it also had no effect.

Do you mean I need to set it up in CFAdministrator?
And if so, do I then revert back to the old tag?

You can’t use an application specific mapping when you’re using inheritance because the CFC is instantiated (along with it’s parent class) before the pseudo constructor gets to run and add the mapping!

Like I said, it needs to be a mapping in the server administrator. This also means you can only have one version of ColdBox on a server at once which is a reason we always use the non-inheritance approach since it allow for app-specific mappings.

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, got it.

However, I am not permitted to use a server mapping on this occasion (a story too long and boring to recount) so I am going to have to refactor the code to use ‘no inheritance’. On my first attempt I get this:

Element INSTANCE is undefined in MEMENTO.

The error occurred in D:/CFDev/coldbox/system/web/ControllerDecorator.cfc: line 24

Called from D:/CFDev/coldbox/system/web/services/RequestService.cfc: line 256

Called from D:/CFDev/coldbox/system/web/services/RequestService.cfc: line 209

Called from D:/CFDev/coldbox/system/interceptors/SES.cfc: line 75

Called from D:/CFDev/coldbox/system/web/services/InterceptorService.cfc: line 204

Called from D:/CFDev/coldbox/system/web/services/InterceptorService.cfc: line 110

Called from D:/CFDev/coldbox/system/web/services/InterceptorService.cfc: line 76

Called from D:/CFDev/coldbox/system/web/services/LoaderService.cfc: line 81

Called from D:/CFDev/coldbox/system/Coldbox.cfc: line 71

Called from D:/CFDev/caseymr/ecreservations/Application.cfc: line 48

22 : // Store Original Controller Memento of instance data and services

23 : var memento = arguments.controller.getMemento();

24 : instance = memento.instance;

25 : services = memento.services;

26 : return this;

My line 48 in Application.cfc is:

44

45

46 //Load ColdBox

47 application.cbBootstrap = CreateObject(“component”,“coldbox.system.Coldbox”).init(COLDBOX_CONFIG_FILE,COLDBOX_APP_ROOT_PATH,COLDBOX_APP_KEY,COLDBOX_APP_MAPPING);

48 application.cbBootstrap.loadColdbox();

49 return true;

50

51

Any thoughts?

Do you have full null support in Lucee turned on by change (if you’re using Lucee, that is).

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

Hi Brad

No, we don’t use Lucee.