Hi CB Group,
I am having an issue getting my new CB4 app installed in a sub directory. I keep getting component not found errors (e.g. invalid component definition, can't find component [coldbox.system.web.Controller] ). The website root directory does not contain any .cfm/.cfc files and no application.cfc - but - it is the root directory in terms of Lucee / Tomcat / IIS. I am trying to install in a sub directory called "tools". All of my app's files, including application.cfc, are in the sub directory. I have been using CB for several years but never had to install in a sub directory. I want to install in the sub directory to avoid conflict with my client's files in the root. It is a Lucee install and not a converted Railo. I built the application initially using box.exe (awesome BTW).
This is my application.cfc that is in the /tools directory. I have tried several things I have found online including updating "COLDBOX_APP_MAPPING" and adding a custom this.mapping for "/coldbox". I also removed the "this.javaSettings" as some people suggested that the AdvancedScript and Simple example app templates were different (the only difference I found was the this.javaSettings). If I add mappings in Lucee directly for /coldbox to /coldbox/tools I then throw an error on "interceptors". If I add a mapping for /interceptors to /interceptors/tools I get further but then my handlers/routes are off. I get an error stating the handler doesn't exist because it's looking at the sub directory as a handler. e.g. "/tools/xyz/abc".
// Application properties
this.name = hash( getCurrentTemplatePath() );
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,0,30,0);
this.setClientCookies = true;
// 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 = "/tools";
// COLDBOX PROPERTIES
COLDBOX_CONFIG_FILE = "";
// COLDBOX APPLICATION KEY OVERRIDE
COLDBOX_APP_KEY = "";
this.mappings["/coldbox"] = 'C:\HostingSpaces\client\clientsite.com\wwwroot\tools\coldbox\';
// application start
public boolean function onApplicationStart(){
application.cbBootstrap = new coldbox.system.Bootstrap( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING );
application.cbBootstrap.loadColdbox();
return true;
}
The only thing I can think of is to install on a sub domain and avoid the whole problem or try to force Lucee to look at the sub directory as it's own context (if that possible but still not ideal for management reasons). I cannot install in the root because the clients files are all HTML.
Any help / advice would be appreciated.
Thank you,
Joe Rebis