[coldbox 3.8.1] Installing Coldbox Application in a sub folder

I am sure this has been addressed elsewhere, but I just haven’t been able to find an answer that works.

I need to install coldbox as a standalone in a sub directory off the sites root … /intranet/, but am getting the following error:


# Could not find the ColdFusion component or interface Coldbox.
Ensure that the name is correct and that the component or interface exists.

The error occurred in /Users/jason/Sites/Defries/defries/intranet/Application.cfc: line 28

<br>26 : // application start<br>27 : public boolean function onApplicationStart(){<br>**28 : application.cbBootstrap = new Coldbox(COLDBOX_CONFIG_FILE,COLDBOX_APP_ROOT_PATH,COLDBOX_APP_KEY);**<br>29 : application.cbBootstrap.loadColdbox();<br>30 : return true;<br>



I have tried setting COLDBOX_CONFIG_FILE to map to the sub folder etc., I have placed both the coldbox and config files in the root, but can’t get past this error.

Site will end up on a shared hosting environment, so I can’t set cf or server mappings.

Any pointers hugely apprecieted



// ColdBox Application Specific, Modify if you need to
COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() );

If you want to change the location of ColdBox you will need to make the change to the COLDBOX_APP_ROOT_PATH so it knows where ColdBox is located. This should be in the documentation.

Where did you get that Application.cfc from. Mine looks like this:

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

Note, it’s creating “coldbox.system.coldbox”, not “coldbox”. Is there an import directive somewhere in there?

You shouldn’t need to touch the config file setting. That is determined automatically by the app root. In most cases, you don’t need to set the COLDBOX_APP_ROOT_PATH either, but if you’re using a remote proxy, then set COLDBOX_APP_ROOT_PATH to the name of the folder that your app is in.



ColdBox Platform Evangelist
Ortus Solutions, Corp

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

There is the problem… thanks Brad.

The Application.cfc is from the the bundle download (fresh download thismorning) /coldbox/ApplicationTemplates/AdvancedScript). On looking at the other templates, they do appear the same as yours, just the AdvancedScript had the … new Coldbox()… I replaced the AdvancedScript with the Advanced template (which had the same call to Coldbox.cfc as you) and all worked fine.

So looks like it is just an issue with the AdvancedScript template which has new coldBox(… where all other templatees have CreateObject(“component”,“coldbox.system.Coldbox”).init(.

Thank you!