Using ColdFusion frameworks on shared hosting
I have had problems in the past when wanting to use a ColdFusion framework such as Mach II, Model Glue, ColdSpring or Reactor in a shared hosting environment.
For example, suppose you install ColdSpring under the /coldspring directory, then everything works just fine. Then another site on the same shared server also installs coldspring, and then goes on to create a /coldspring ColdFusion mapping to point to their /coldspring directory. Suddenly your site will try to run their copy of the ColdSpring and not yours. Not so good.
It turns out to be quite easy to get around this by simply renaming all of the component references in whatever framework you are using so that the framework is sitting under your own custom directory.
For example, suppose your company is "ACME Web Products" then you can create a directory on the site called "/acme" and pop your copy of ColdSpring, or Mach II etc. under there.
For coldspring you would rename as follows:
Rename ["coldspring.] to ["acme.coldspring.]
Rename ['coldspring.] to ['acme.coldspring.]
(leave out the square brackets, of course)
This handles cases where the strings use double quote or single quotes in the framework code.
The when you want to instantiate your copy of ColdSpring (or Mach II etc), just use your extra directory name:
There may be a couple of other references that may need to be changed, but they are usually quite easy to fix.

<cfset THIS.customTagPaths = listAppend(customtagpaths, expandPath('/coldspring')) />
THIS.customTagPaths is a common delimited list of custom tag / component directories. The above example uses the expandPath function to supply a relative directory.
You can read more here:
http://livedocs.adobe.com/coldfusion/8/htmldocs/he...
@Adrock, I have heard about this but not looked into it. This was one of my biggest gripes with CF and this new change is outstanding news. Thanks for the link!
Better to avoid hosting companies that let you hijack other people's paths. CrystalTech is one that should be avoided in this situation (unless you're on CF8 - see Adrock's comment). HMS do NOT have this problem as they only let you create mappings that include your customer number (so you CAN'T create /coldspring, only /coldspring_h1234 or something similar). So Dan will not be affected because he's on a smart hosting company.
Of course, the best solution is to use a host such as HMS (I was not aware of their mapping policy - good to know there are intelligent CF hosts available), but if this is not possible then I would certainly consider the approach above.
Overall, this is perhaps not much of an issue any longer with new projects and CF8 site mappings available.
I did try using the method specified by Adrock above but to no avail, I'm afraid. I need to use Model-Glue and ColdSpring.
I did verify that my account is indeed on ColdFusion 8 and not MX7.
So, basically, based on Adrock's suggestion, I added the following to my Application.cfc file:
<cfset this.customTagPaths = listAppend(customtagpaths, expandPath('/coldspring')) />
<cfset this.customTagPaths = listAppend(customtagpaths, expandPath('/ModelGlue')) />
Am I doing anything incorrectly here?
(NOTE: the good people at HMS have told me they will definitely look into this and get right back with me on how it can be set up but in the meantime I'm trying to see if there is any info out there on workarounds already in use.)
Thank you for any additional suggestions any of you might be able to provide!!
Best,
Tony
MG and CS should work fine at HMS without any mappings or custom tag paths. I haven't tried, but I understand this to be the case.
When I spoke on the phone to a HMS tech support rep earlier today, he was looking on the server to see if they had it set up and it sounded like they did have ColdSpring but not Model-Glue set up. I'm flummoxed by this considering others sound like they are using it without any problems. But then when I actually speak to HMS they keep telling me it's not installed but I can put the MG installation packages at the root of my site and then create a mapping.
Not sure what to do at this point.
Thanks again!
Best,
Tony
I am using HMS.
But I have noticed that the site is very slow.
Sometimes a page loads in 10-15 seconds and then other times it loads in less than 1 second.
I just signed up with them two days ago and I am pretty disappointed with the speed.
I have ensure that all MG reload variables ( setting in coldspring.xml ) are set to false - so the site will not reload all the time. This does not seem to be the problem.
Has anyone experienced this with HMS ?
"Could not find the ColdFusion Component coldspring.beans.DefaultXmlBeanFactory.
Please check that the given name is correct and that the component exists.
The error occurred in /devel/nw/config/settings.cfm: line 71
Called from /devel/nw/config/settings.cfm: line 48
Called from /devel/nw/config/settings.cfm: line 15
Called from /devel/nw/config/settings.cfm: line 1
Called from /devel/nw/Application.cfc: line 29
70 :
71 : <cfset application.serviceFactory=createObject("component","coldspring.beans.DefaultXmlBeanFactory").init() />"
I added the following to Sava's Application.cfc, inside the tag <cfcomponent>:
<cfset customtagpaths = "/devel/nw">
<cfset this.customTagPaths = listAppend(customtagpaths, expandPath('/coldspring')) />
Did I do something wrong? Thanks for the post!
Pedro.
paths won't work. You will either need to
a) Put the coldspring into the root directory of your website (which
may or may not be a problem on a shared host, depending on the host)
b) Put coldspring in a subdirectory (e.g. '/nw/coldspring'), rename all of the components as described in this entry (with the understanding that some functionality of the framework may become unavailable), the create coldspring using:
<cfset application.serviceFactory=createObject("component","nw.coldspring.beans.DefaultXmlBeanFactory").init() />
If at all possible, use a shared host that does would not allow anyone to create a "coldspring" mapping (e.g. HMS) and all should be fine.
Hope that helps.