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
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.
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();