Cannot use Coldbox 4.2.0 with Adobe Builder 3

Hello. I have been working on converting a Fusebox 5 application over to Coldbox. To date, most of the work was done using Command Box’s built-in server. I am now trying to move the application over to the Adobe CF11 server that is built in to AB3. Unfortunately, I keep getting the following error:

# Could not find the ColdFusion component or interface coldbox.system.web.services.BaseService.



This occurs in even brand new projects that have not been altered. The ColdBox directory is under the root of my project. The BaseService.cfc file is in the services directory where it belongs. Any ideas?

Thanks

Hi Paul,

Try to add “coldbox” mapping in your Application.cfc

this.mappings[ “/coldbox” ] = getDirectoryFromPath( getCurrentTemplatePath() );

Sana,

Unfortunately, that did not help. Still receiving the same error. I have included the full error message below:

# Could not find the ColdFusion component or interface coldbox.system.web.services.BaseService.
Ensure that the name is correct and that the component or interface exists.

The error occurred in C:/ColdFusionBuilder3/ColdFusion/cfusion/wwwroot/CBTest/coldbox/system/web/Controller.cfc: line 88
Called from C:/ColdFusionBuilder3/ColdFusion/cfusion/wwwroot/CBTest/coldbox/system/Bootstrap.cfc: line 69
Called from C:/ColdFusionBuilder3/ColdFusion/cfusion/wwwroot/CBTest/Application.cfc: line 30
|


<br>86 : <br>87 : // LogBox Default Configuration & Creation<br>**88 : services.loaderService = new coldbox.system.web.services.LoaderService( this );**<br>89 : variables.logBox = services.loaderService.createDefaultLogBox();<br>90 : variables.log = variables.logBox.getLogger( this );<br>

|

Here is the beginning of my Application.cfc:

`

component{
// Application properties
this.name = hash( getCurrentTemplatePath() );
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,0,30,0);
this.setClientCookies = true;
this.mappings[ “/coldbox” ] = getDirectoryFromPath( getCurrentTemplatePath() );

// COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP
COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() );
// The web server mapping to this application. Used for remote purposes or static purposes
COLDBOX_APP_MAPPING = “”;
// COLDBOX PROPERTIES
COLDBOX_CONFIG_FILE = “”;
// COLDBOX APPLICATION KEY OVERRIDE
COLDBOX_APP_KEY = “”;
// JAVA INTEGRATION: JUST DROP JARS IN THE LIB FOLDER
// You can add more paths or change the reload flag as well.
this.javaSettings = { loadPaths = [ “lib” ], reloadOnChange = false };

`

That file doesn’t exist in ColdBox 4.2

Please confirm exactly what version of ColdBox you have installed here:
C:/ColdFusionBuilder3/ColdFusion/cfusion/wwwroot/CBTest/coldbox/

You can look in coldbox/system/web/config/settings.cfc to confirm.

What I think is likely the problem is that you have more than one copy of ColdBox floating around your server. Check for a server level CF mapping for /coldbox that might be getting in the way. Also, ensure in your ColdFusion administrator that you have the cache component paths turned off as that can allow for nasty bleed over from other sites.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Version is 4.2.0+00002. Coldbox was installed to the project via CommandBox. I have turned off the cache component and restarted the server. I also verified that no mappings exist at the server level for Coldbox. Same error. Not certain I understand “that file doesn’t exist in Coldbox 4.2”. Below is my coldbox dir structure:

BaseService.cfc is present under the web/services folder.

Oops, sorry. I was working with ColdBox 3 last night where the services folder was elsewhere.

I would edit the Controller file and start putting in some debugging right before the line that’s erroring. I’d start with:

writeDump( expandPath( ‘/coldbox’ ) );
writeDump( directoryList( ‘/coldbox/system/web/services’ ) );
abort;

I still think there’s another mapping getting in the way somewhere. See what the above outputs and if it give you any clues where ColdFusion is looking for your files.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Added code. Here is the output:
C:\ColdFusionBuilder3\ColdFusion\cfusion\wwwroot\CBTest

array [empty]

Odd that it shows the directory as empty, but can find the LoggingService.cfc to know it inherits from BaseService.cfc.

Thank you again for helping out. I’m pretty new with ColdBox. I can run it under the built-in CommandBox server, but that won’t help much going forwards!

-Paul

> C:\ColdFusionBuilder3\ColdFusion\cfusion\wwwroot\CBTest

That doesn’t look right at all. The /coldbox mapping shouldn’t pointing to CBTest, it should be pointing to
C:/ColdFusionBuilder3/ColdFusion/cfusion/wwwroot/CBTest/coldbox

Looking again at your mappings, I can see why:

this.mappings[ “/coldbox” ] = getDirectoryFromPath( getCurrentTemplatePath() );

That’s not right at all. You’re pointing the coldbox mapping to the root folder that the app lives in. That mapping needs to point to the coldbox folder.

this.mappings[ “/coldbox” ] = getDirectoryFromPath( getCurrentTemplatePath() ) & ‘/coldbox’;

ColdFusion seems a little confusing in how it resolves mappings sometimes which is why I think the framework was able to SOMEWHAT boot up by finding the coldbox folder there in the app root. however, at some point, it starts using the mapping which doesn’t work. This is probably due to the rules for cfc path lookups where the current dir is checked before mappings. The first file to run (Application.cfrc) is in the same folder as the coldbox folder so the code in there finds the framework.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Thank you Brad! That was the issue.