Tuesday, March 16, 2010

ColdFusion Application.cfc/Application.cfm lookup order gotcha!

So today I experienced this weird problem that had me going crazy and basically it is not a bug just a new feature that I wasn't thinking of. ColdFusion 9 has a new lookup order for an Application file, basically by default it will look all the way up to the system root rather than the web root.

So this morning I downloaded a file for a customer I had to review for some changes. This file is an Application.cfc file and I had placed it in my user folder. Now my web root is in my "user folder"/Workspace/Site/ and every time I was trying to browse to it I kept getting a cfmail error. Now my simple index.cfm had nothing in it that specified a cfmail action. So I then decided to set a default mail server on my local instance of CF and look at my undeliverable folder because I knew it would fail. Alas, I recognized the error and it was coming from this Application.cfc, but how? There you go .. that was my gotcha and then I remember about the new lookup. So I logged in to admin, went to settings and changed the lookup to go stop at my web root and error fixed.

Hope this helps someone, it only took a second for me to figure out but I decided, what the hell, let me write about it.


No comments:

Post a Comment