2
votes

I've been having a sporadic problem for a few weeks where on restarting the CF Server (Enterprise 9) one of my applications runs without ColdFusion referencing all the variables in the Application.cfc file. It's in the same folder as the CFML pages, it IS properly capitalised as Application.cfc, but it seems to just be ignored. Obviously this causes problems with datasource name and all the other variables I set in Application.cfc. For reference, I'm using an Application.cfc file based on Ben Nadel's excellent intro at http://www.bennadel.com/blog/726-ColdFusion-Application-cfc-Tutorial-And-Application-cfc-Reference.htm . Usually my requested template runs as an include and I can see it in the stack using debugging output, now I can't see it there at all. It's as if the file just doesn't exist.

Has anyone else experienced this, or can you think of possible solutions? Note that at times a restart has got the whole thing running perfectly smoothly.

Re folder structure it's really simple: the Application.cfc file is in the web root along with executable CFML templates - included templates, images, CSS etc are in separate folders referenced via relative paths.

There is another application with its own similar Application.cfc file that is in a sub-directory of the web root. This is running perfectly.

1
It would be best to post the Application.cfc so we can scout for any potential issues. Also some information about the directory structure. - BKK
Also post the file/directory structure of the relationships between the file being requested, the Application.cfc, the web root and the ColdFusion root. - Adam Cameron
OK - I seem to have fixed this, by using CF Admin to set the 'Application.cfc/Application.cfm lookup order' to 'Default order' rather than 'Until web root'. Perhaps there was some conflict because there are multiple web root folders on the server? - trscairns
Are the application names the same in both application.cfc? If they are, and a user visits the sub-application first, the main application will be defined per the settings in the sub-application. - Travis
Thanks, travis. No, the application names are distinct. The problem seems to have been connected to ColdFusion's settings for locating the Application.cfc file as outlined in my comment above. - trscairns

1 Answers

0
votes

Try clearing your template cache. I've see cases where CF just gets flakey and the cached files are causing issues. Another option: Does ColdFusion have permissions to read/execute the Application.cfc? If this WAS an issue but is no longer an issue I've seen cases where the template cache was causing these files not to be found. Again, delete these files (from disk, not the cfadmin) and try again.