November 27, 2017
How do I install ColdBox with CommandBox on a local ColdFusion service?
Comments
(6)
November 27, 2017
How do I install ColdBox with CommandBox on a local ColdFusion service?
Director of Web Programming
Newbie 1 posts
Followers: 0 people
(6)

I installed ColdBox with CommandBox, but when I try to run it on my localhost ColdFusion server (not in CommandBox), I get various mapping errors. Are there some standard tweaks I can make to get this to work?

I will provide more specific errors if you want, but I figure since I’m not doing anything custom yet and just using one of the out-of-the-box templates, I thought I should get some more general advice first.

This is a Microsoft Windows setup with IIS and ColdFusion 2016.

 

Thanks,

 

Don

6 Comments
2017-11-30 17:00:23
2017-11-30 17:00:23

okay, I will move further questions to Google or Slack. Thanks!

Like
2017-11-29 23:13:01
2017-11-29 23:13:01

I don’t see anything on that doc page that mentions putting the entire app in a sub folder. All I see is a mention that the ColdBox framework goes in its own folder alongside your app. You can certainly put your app in a subfolder if you wish, but you’ll just need to create a mapping for the framework. Based on your first error you mentioned above, you are hitting the scenario I mentioned above when the coldbox folder is not in the web root, but you haven’t created a mapping.

You mentioned that you tried to create a mapping it errored, but I can’t help you unless you share the error as well. Also, seeing the this.mappings code would be useful as well.

None of this is really ColdBox-specific. All you need to know here is the rules that ColdFusion uses to resolve CFC paths. Regardless of where your app lives or where the framework lives, /coldbox just needs to resolve to the folder that contains the ColdBox framework. If you do that, the app will work.

This portal also doesn’t seem to notify me of new messages. Feel free to take this to our Google group or the CFML Slack team where we can chat in real time about it.

Like
2017-11-29 22:48:44
2017-11-29 22:48:44

sorry, forgot to mention a couple things: c:\labtestsec is the web root

the instructions I’m talking about are: https://coldbox.ortusbooks.com/content/full/overview/installation.html

Like
2017-11-29 22:38:18
2017-11-29 22:38:18

Hi Brad,

Thank you for taking the time to respond! I am definitely alone here, so no relation to Mike at Google Groups.

This is my entire commandbox session. I tried to follow the instructions for “Hello World” except I used the “Simple” skeleton. *The instructions tell me to install coldbox in a subfolder*

The app fails on this line in the controller:

services.loaderService = new coldbox.system.web.services.LoaderService( this );

but if I try to set mappings in application.cfc, then the application.cfc fails on this line:

application.cbBootstrap = new coldbox.system.Bootstrap( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING );

I can’t find any examples of setting a subfolder in the mappings, so maybe I’m doing it wrong. But this is how the instructions say to set up the application, so I’m quite confused at this point.

_____ _ ____
/ ____| | | _ \
| | ___ _ __ ___ _ __ ___ __ _ _ __ __| | |_) | _____ __
| | / _ \| ‘_ ` _ \| ‘_ ` _ \ / _` | ‘_ \ / _` | _ cd c:\labtestsec
C:\labtestsec\
CommandBox:labtestsec> mkdir lpi3
Created C:\labtestsec\lpi3
CommandBox:labtestsec> cd lpie3

ERROR (3.9.0+00819)

C:\labtestsec\lpie3: No such file or directory

CommandBox:labtestsec> cd lpi3
C:\labtestsec\lpi3\
CommandBox:lpi3> install coldbox

Installing package [forgebox:coldbox]
Verifying package ‘coldbox’ in ForgeBox, please wait…
Installing version [4.3.0+188].
Verified entry in ForgeBox: ‘coldbox’
Package found in local artifacts!
Decompressing…
C:\labtestsec\lpi3\/box.json updated with dependency.
Installing to: C:\labtestsec\lpi3\/coldbox
-> 209 File(s) Installed
-> 0 File(s) ignored
Eureka, ‘coldbox’ has been installed!

CommandBox:lpi3> coldbox create app name=lpi3 skeleton=Simple

Installing package [forgebox:cbtemplate-simple]
Verifying package ‘cbtemplate-simple’ in ForgeBox, please wait…
Installing version [1.4.0].
Verified entry in ForgeBox: ‘cbtemplate-simple’
Package found in local artifacts!
Decompressing…
Installing to: C:/labtestsec/lpi3/
-> 63 File(s) Installed
-> 1 File(s) ignored
Eureka, ‘cbtemplate-simple’ has been installed!

Installing package [forgebox:coldbox@^4.3.0]
Verifying package ‘coldbox’ in ForgeBox, please wait…
Installing version [4.3.0+188].
Verified entry in ForgeBox: ‘coldbox’
Package found in local artifacts!
Decompressing…
The package coldbox is already installed at C:\labtestsec\lpi3/coldbox. Skipping installation. Use –force option to force install.

CommandBox:lpi3> coldbox create controller name=hello actions=index,echo

Created C:\labtestsec\lpi3\views\/hello/index.cfm
Created C:\labtestsec\lpi3\views\/hello/echo.cfm
Created C:\labtestsec\lpi3\handlers\/hello.cfc
Created C:\labtestsec\lpi3\tests\specs\integration\/helloTest.cfc
CommandBox:lpi3>

Like
2017-11-29 20:21:47
2017-11-29 20:21:47

Whether or not you use CommandBox to install ColdBox, the answer is the same. Basically “/coldbox” needs to map to the coldbox folder (the one that contains the “system” subdirectory. Now, there’s more than one way to do this, and you’ve given basically zero information about your setup and file structure, so I have no idea which ones fit your needs.

1) The first approach is to place the ColdBox folder in the web root. A common issue is people try to put their ColdBox app in a sub folder, and they try to put the framework in that same sub folder.

2) The second approach is that you create a server or Application-specific mapping called “/coldbox” that points to the folder– wherever it is.

If that doesn’t fix your issues, you’ll need to provide a lot more information about what your doing and exactly what errors you’re encountering. So long as /coldbox resolves, everything else should “just work”.

BTW, I’m having a strikingly similar conversation right now on the Google group here: https://groups.google.com/d/topic/coldbox/R2EvgMHjs7g/discussion
If that’s a coworker of yours, it might help to consolidate this discussion to one place. If not, go ahead and read it because everything I’ve said there applies to you 🙂

Like
2017-11-28 13:14:57
2017-11-28 13:14:57

Hi Don,

usually you need to set up a CF mapping “/coldbox” that points to your coldbox directory. Whether you need any other mappings is impossible to say without the error messages.

Cheers

Chris

Like
Add Comment