Highlighted

Coldfusion per application mapping randomly fails

Explorer ,
Mar 11, 2019

Copy link to clipboard

Copied

In my application.cfc file I have the following code:

this.mappings["/includes"] = "#expandPath('../../priv/inc/')#";

and then on a page I have the following CF include set up:

<cfinclude template="/includes/imageOptimise-thumbnail.cfm">

For the majority of the time when the page is submitted the imageOptimise-thumbnail page runs without any issue but occasionally it will error saying that it can't find the imageOptimise-thumbnail.cfm. If I resubmit the page, chances are it will work but the question is, why is it sometimes not being able to find the page?

I had a look in the CF Admin and I can't see anything in the logs saying that there was an error but it is clearly showing a Coldfusion 'template not found' error message when it fails.

Anyone got any ideas?

Views

209

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Coldfusion per application mapping randomly fails

Explorer ,
Mar 11, 2019

Copy link to clipboard

Copied

In my application.cfc file I have the following code:

this.mappings["/includes"] = "#expandPath('../../priv/inc/')#";

and then on a page I have the following CF include set up:

<cfinclude template="/includes/imageOptimise-thumbnail.cfm">

For the majority of the time when the page is submitted the imageOptimise-thumbnail page runs without any issue but occasionally it will error saying that it can't find the imageOptimise-thumbnail.cfm. If I resubmit the page, chances are it will work but the question is, why is it sometimes not being able to find the page?

I had a look in the CF Admin and I can't see anything in the logs saying that there was an error but it is clearly showing a Coldfusion 'template not found' error message when it fails.

Anyone got any ideas?

Views

210

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 11, 2019 0
LEGEND ,
Mar 11, 2019

Copy link to clipboard

Copied

We've been suffering from this for ages, and I have not found a solution for it.  Our org inbox is inundated with emails triggered when the header.cfm page cannot be found.

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 11, 2019 0
BKBK LATEST
Adobe Community Professional ,
Mar 11, 2019

Copy link to clipboard

Copied

Does adding the runonce attribute help? Assuming you're on ColdFusion 10 or above, the syntax is

<cfinclude template="/includes/imageOptimise-thumbnail.cfm" runonce="true">

Oh, and just an aside, I would avoid using a dash in a CFML file name.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 11, 2019 0