[Coldbox 4.3.0] Getting the initial settings right

Having had significant difficulties with various shared hosting companies (way too long and boring to go into) I am forced to refactor the location of the Coldbox files in relation to my application files. And I can’t get the application to fire up.

The coldbox directory is no longer at the webroot but is now a directory inside my site root.

My Application.cfc settings are these:

// 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 = “”;

getDirectoryFromPath( getCurrentTemplatePath() ) resolves to “/Applications/ColdFusion11/cfusion/wwwroot/myApp/”

And here’s the error:

Is there a mapping called “/coldbox” that points to the roof of where the Coldbox framework lives? Also, when you say “ColdBox files”, I’m unclear on whether you mean the ColdBox framework, or your app itself.

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

Is there a mapping called “/coldbox” that points to the roof of where the Coldbox framework lives?

No. Do I need one? Something like this?

this.mappings[ ‘/coldbox’ ] = “???”;

Also, when you say “ColdBox files”, I’m unclear on whether you mean the ColdBox framework, or your app itself.

The coldbox framework files are in a directory called ‘coldbox’ which is inside my application, so the at the same level as the Application.cfc.

No. Do I need one?

If it’s not in the web root, yes.

The coldbox framework files are in a directory called ‘coldbox’ which is inside my application, so the at the same level as the Application.cfc.

Unless it’s in the web root, you need a mapping. That’s just how CF works

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

Okay, so I added a mapping:

this.mappings[ ‘/coldbox’ ] = COLDBOX_APP_ROOT_PATH & “coldbox/”;

This resolves to:
/Applications/ColdFusion11/cfusion/wwwroot/myApp/coldbox/
which is correct.

Yet, I still get the same error

Could not find the ColdFusion component or interface /Applications/ColdFusion11/cfusion/wwwroot/coldbox/system/Bootstrap.cfc.

I have tried experimenting with the following settings:

COLDBOX_APP_MAPPING = COLDBOX_APP_ROOT_PATH;

COLDBOX_CONFIG_FILE = COLDBOX_APP_ROOT_PATH & “config/ColdBox.cfc”;

Everything seems to point to the right places, yet the same error persists. The Application.cfc is still looking ‘one level up’ for the coldbox directory.

This is just SO frustrating. There must be an answer, it must be a simple one, but I can’t find it…

Okay, I gave up on this, and reverted to an older configuration I had that was working on a shared server (Linux). This application and configuration has been deployed on a new shared server (Windows) and again there seems to be some sort of problem.

The coldbox directory is located at the first level inside the application root as before.

The error is:

Security: The requested template has been denied access to D:/Inetpub/tcbader/cbsys/system.
The following is the internal exception message: access denied (“java.io.FilePermission” “D:/Inetpub/tcbader/cbsys/system” “read”)

The stacktrace looks like this:

java.security.AccessControlException: access denied (“java.io.FilePermission” “D:/Inetpub/tcbader/cbsys/system” “read”) at cfController2ecfc1578177641$funcLOADCOLDBOXSETTINGS.runFunction(D:/Inetpub/zazzu/coldbox/system/web/Controller.cfc:739) at cfController2ecfc1578177641$funcINIT.runFunction(D:/Inetpub/zazzu/coldbox/system/web/Controller.cfc:104) at cfBootstrap2ecfc1389562529$funcLOADCOLDBOX.runFunction(D:/Inetpub/zazzu/coldbox/system/Bootstrap.cfc:68) at cfApplication2ecfc415942325$funcONAPPLICATIONSTART.runFunction(D:/Inetpub/zazzu/Application.cfc:27)

And my question is, why is the ‘coldbox/system/web/Controller.cfc:739’ suddenly trying to find a coldbox file several levels up the tree? And what can I do in my settings to correct this?