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
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.
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
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>
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 🙂
You must be logged in to post a comment.