ColdBox 4 Issues installing in sub directory

299 views
Skip to first unread message

Joseph Rebis

unread,
Oct 28, 2015, 2:14:49 PM10/28/15
to ColdBox Platform


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


br...@bradwood.com

unread,
Oct 28, 2015, 2:19:28 PM10/28/15
to col...@googlegroups.com
Are you using inheritance on your application.cfc?  There's really no trick to making this work-- coldbox.system.bootstrap simply needs to resolve via a mapping or the standard component lookup order.  Is ColdBox installed somewhere entirely outside your web root?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/69cd66ca-be26-4b50-a56f-8230416d3808%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joseph Rebis

unread,
Oct 29, 2015, 5:37:34 PM10/29/15
to ColdBox Platform
Hi Brad,

Thanks for your reply. All files including the application.cfc are in the sub-directory which is under the web root. There is not an application.cfc in the root of the site- only in the sub-directory.Do I need an application.cfc in the root of the website? The ColdBox files are in the sub-directory called tools.

wwwoot
----Other HTML files
----Web-Inf etc
----Tools (coldbox & app files in this dir)
--------application.cfc
--------coldbox
------------system

Thanks,

Joe

br...@bradwood.com

unread,
Oct 29, 2015, 5:52:32 PM10/29/15
to col...@googlegroups.com
I don't see any issues there right off.  Can you check to make sure the path for your /coldbox mapping is correct.  I would recommend change it to a relative expandPath().  Also, check for a server level /coldbox mapping that might be pointing to an old version of ColdBox.
--------- Original Message ---------

Andrew Scott

unread,
Oct 29, 2015, 7:26:34 PM10/29/15
to col...@googlegroups.com
He needs a mapping for ColdBox does he not.

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


Brad Wood

unread,
Oct 29, 2015, 7:39:08 PM10/29/15
to col...@googlegroups.com
His original post showed one.



Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5

Andrew Scott

unread,
Oct 29, 2015, 9:52:25 PM10/29/15
to col...@googlegroups.com
lol, oops I did miss that.

Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/


Joseph Rebis

unread,
Oct 30, 2015, 6:02:27 PM10/30/15
to ColdBox Platform
Hi Guys,

Thanks, the path to Coldbox mapping is correct. There is no server level mapping (new CF install). I tried using expandPath() which worked except I then had to add one for interceptors. Ultimately, it resulted in an error where the tools directory is being looked at like a handler. e.g. Error message The event: tools.myHandler is not valid registered event.

I thought that this would be accounted for automatically but perhaps not. The routes folder should use the value of COLDBOX_APP_MAPPING for setBaseURL() function. Is there somewhere else I can set that?

this.mappings["/coldbox"] = ExpandPath('/tools/coldbox');
this.mappings["/interceptors"] = ExpandPath('/tools/interceptors');

Thanks,

Joe 

br...@bradwood.com

unread,
Oct 30, 2015, 6:17:21 PM10/30/15
to col...@googlegroups.com
Hmm, there must be something screwy going on with your server.  ColdBox should just work fine.
--------- Original Message ---------

Joseph Rebis

unread,
Oct 30, 2015, 7:02:25 PM10/30/15
to ColdBox Platform
Could be - this is the first time I am using Lucee (Lucee installer). If you are saying that given these settings it should work I will take that on face value and bailout. I am just going to load it on a sub domain and forget about the sub-directory- and try to enjoy my weekend.

Thanks for the super speedy replies.

Joe 

Andrew Scott

unread,
Oct 30, 2015, 7:06:47 PM10/30/15
to col...@googlegroups.com
I don't think you need to do a mapping for interceptors though.

Regards,
Andrew Scott


Reply all
Reply to author
Forward
0 new messages