Using coldbox 4 in subdirectory

185 views
Skip to first unread message

Christopher Tierney

unread,
Nov 17, 2014, 6:13:38 PM11/17/14
to col...@googlegroups.com
I have an existing site in a hacked-up version of FuseBox. I am doing a slow migration to ColdBox and this is my first CB app ever.

  1. I created "mysite/C" and ran "coldbox create app" from CommandBox.
  2. I copied the coldbox directory (coldbox-4.0.0+00002-201411120022) into /C
  3. I added a mapping to the App.cfc (this.mappings["/coldbox"] = getDirectoryFromPath(getCurrentTemplatePath()) & '/coldbox';) and verified it was running from this directory via a cfdump.
  4. Changed the app mapping: COLDBOX_APP_MAPPING   = "/C";
  5. Changed the ColdBox call (new coldbox.system.Coldbox to new coldbox.system.Bootstrap)
This is all I did.

But it wants to include my root index.cfm for some reason (/index.cfm). It's not extended my root App.cfc either.

If I put an abort in /index.cfc, it looks like it picks up the main.cfm layout file, then tries to insert /index.cfm when renderView() is called.

Is there something I need to be changing? Perhaps a bug with v4?

Thanks in advance.
Chris

Christopher Tierney

unread,
Nov 17, 2014, 6:39:32 PM11/17/14
to col...@googlegroups.com
I just downloaded the bundle from coldbox.org/download and used the "SuperSimple" template in my "/C" directory and it works fine. Haven't figured out what was causing that issue yet. But something to look at when using "coldbox create app" in CommandBox though.

Chris

Christopher Tierney

unread,
Nov 17, 2014, 6:57:07 PM11/17/14
to col...@googlegroups.com
The difference is in SuperSimple vs. Simple. Looks like CommandBox installs the "simple" version. SuperSimple is the one that works for me.

Chris

Christopher Tierney

unread,
Nov 17, 2014, 7:12:09 PM11/17/14
to col...@googlegroups.com
I was able to narrow it down even further. Seems to have to do with SES - I guess that makes sense since it would be a general config usually basic upon a root layout.

Coldbox.cfc: interceptors = [{class="coldbox.system.interceptors.SES", properties={}}];

If I take that out it works just fine. So I'm going to leave it at that.

Chris

br...@bradwood.com

unread,
Nov 17, 2014, 7:41:10 PM11/17/14
to col...@googlegroups.com
Hmm, that doesn't seem like it should be an issue at all.  And just to clarify, the problem you're experiencing is that the index.cfm in your web root is being executed along with every ColdBox request inside of a sub folder?  
  • Please put a <cfthrow> in your root index.cfm and report back with the stack trace.  That will tell us what files are getting run and in what order that are including the index.cfm.  
  • Also, please confirm what URL you are hitting.
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 ---------
Subject: [coldbox:22854] Re: [coldbox 4-BE] Using coldbox 4 in subdirectory
From: "Christopher Tierney" <ch...@cfwebtools.com>
Date: 11/17/14 6:12 pm
To: col...@googlegroups.com

I was able to narrow it down even further. Seems to have to do with SES - I guess that makes sense since it would be a general config usually basic upon a root layout.
 
Coldbox.cfc: interceptors = [{class="coldbox.system.interceptors.SES", properties={}}];
 
If I take that out it works just fine. So I'm going to leave it at that.
 
Chris

On Monday, November 17, 2014 5:39:32 PM UTC-6, Christopher Tierney wrote:
I just downloaded the bundle from coldbox.org/downloadand used the "SuperSimple" template in my "/C" directory and it works fine. Haven't figured out what was causing that issue yet. But something to look at when using "coldbox create app" in CommandBox though.
 
Chris

On Monday, November 17, 2014 5:13:38 PM UTC-6, Christopher Tierney wrote:
I have an existing site in a hacked-up version of FuseBox. I am doing a slow migration to ColdBox and this is my first CB app ever.
 
  1. I created "mysite/C" and ran "coldbox create app" from CommandBox.
  2. I copied the coldbox directory (coldbox-4.0.0+00002-201411120022) into /C
  3. I added a mapping to the App.cfc (this.mappings["/coldbox"] = getDirectoryFromPath(getCurrentTemplatePath()) & '/coldbox';) and verified it was running from this directory via a cfdump.
  4. Changed the app mapping: COLDBOX_APP_MAPPING   = "/C";
  5. Changed the ColdBox call (new coldbox.system.Coldbox to new coldbox.system.Bootstrap)
This is all I did.

But it wants to include my root index.cfm for some reason (/index.cfm). It's not extended my root App.cfc either.

If I put an abort in /index.cfc, it looks like it picks up the main.cfm layout file, then tries to insert /index.cfm when renderView() is called.

Is there something I need to be changing? Perhaps a bug with v4?

Thanks in advance.
Chris

 

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Christopher Tierney

unread,
Nov 18, 2014, 12:03:09 PM11/18/14
to col...@googlegroups.com
* Correct - index.cfm is in the web root
* I put a cfthrow in there, but I'm not sure yet how to manipulate ColdBox to show me the stack trace instead of the pretty error.

This is running on Windows 7, IIS with ColdFusion 9.0.1.

Steps taken in a brand new directory:

1. Run CommandBox CLI
2. Change to c:\inetpub\wwwroot\mysite\www\C
3. "coldbox create app"
4. install ColdBox-be
5. Edit \C\Application.cfc and add:
5a. this.mappings["/coldbox"] = getDirectoryFromPath(getCurrentTemplatePath()) & '/coldbox';
5b. COLDBOX_APP_MAPPING   = "/C";

The above can be duplicated by installing the packages as I described previous. Guessing the SES interceptor isn't playing nice with IIS - just a guess.

The error you get is:

Type: HandlerService.EventHandlerNotRegisteredException 
Messages: The event: index is not valid registered event.

If you add /index.cfm it will run whatever is in there like an abort or throw.

Chris

br...@bradwood.com

unread,
Nov 18, 2014, 12:25:39 PM11/18/14
to col...@googlegroups.com
Yeah, I think we could improve the messaging on the public error template to be a bit more specific.  All you need to do is add/edit your coldbox.customErrorTemplate setting in /config/ColdBox.cfc to point to /coldbox/system/includes/BugReport.cfm and reinit the framework  Then you'll see the full error.  
 
Ideally, don't do this in the main configure method, but instead set up environment detection and override it in a development method so your production site is still more secure.  The idea is that you'll create your own custom error template that has your site's look and feel that divulges no information on production.
Reply all
Reply to author
Forward
0 new messages