Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

OnRequestEnd.cfm problem

Guest
Sep 20, 2008 Sep 20, 2008
I created a page in the test directory which is under the wwwroot directory. When I rename the file to something else in order to avoid being found by CF, then I get an error "File not found: C:\ColdFusion8\wwwroot\test\OnRequestEnd.cfm".

This behaviour is seen only on some pages not all and I am not able to see any pattern among the pages where this problem is seen. When I restart the server, the problem is solved and all pages are rendered properly. As soon as i create the file, issue a request and then rename the file to something else, the problem resurfaces.

Can anyone throw more light on this?
TOPICS
Getting started
895
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 21, 2008 Sep 21, 2008
I had that problem, too. It is easy to reproduce.

Put Application.cfm, OnRequestEnd.cfm and a number of CFM pages, say, p1.cfm, p2.cfm and p3.cfm in a directory. Run the pages p1.cfm and p2.cfm. Rename the file OnRequestEnd.cfm to OnRequestEnd2.cfm.

If you now rerun p1.cfm and p2.cfm, you will get the File Not Found error. However, p3.cfm will run without error. It is clear what is happening. The pages that you ran earlier when OnRequestEnd.cfm was present are the ones that give an error whe...
Translate
Guest
Sep 20, 2008 Sep 20, 2008
I guess my mails a little confusing. Apologies for the same. What I meant to say was when I created the OnRequestEnd.cfm the first time in my directory and requested for some page, I can see the OnRequestEnd.cfm getting executed. But as soon as I remove the OnRequestEnd.cfm file, I get the error mentioned in my post above.

I hope this clears the missing element of my question.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2008 Sep 21, 2008
LATEST
I had that problem, too. It is easy to reproduce.

Put Application.cfm, OnRequestEnd.cfm and a number of CFM pages, say, p1.cfm, p2.cfm and p3.cfm in a directory. Run the pages p1.cfm and p2.cfm. Rename the file OnRequestEnd.cfm to OnRequestEnd2.cfm.

If you now rerun p1.cfm and p2.cfm, you will get the File Not Found error. However, p3.cfm will run without error. It is clear what is happening. The pages that you ran earlier when OnRequestEnd.cfm was present are the ones that give an error when OnRequestEnd.cfm is absent.

OnRequestEnd.cfm is just an included page. You can therefore reproduce the problem with any included page, if you follow the same steps.

I think it happens because Coldfusion caches the pages it has run, together with any includes like OnRequestEnd.cfm that the pages may contain. When a page is subsequently requested, Coldfusion will, for efficiency, simply recycle the cached copy of the page when it detects that there has been no change to its content. Hence the continued File Not Found error.

So, in your case, one obvious way to avoid the error is to perform some dummy action to the page, like adding a space, and re-saving the file. A second way out is to clear the template cache in the Coldfusion Administrator. (Both methods assume that you have unchecked the Trusted cache setting in the Administrator).




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