tracker issue : CF-3358817

select a category, or use search below
(searches all categories and all time range)
Title:

Application.cfc-set mappings don't work in onApplicationEnd()

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 11/03/2012

Components: Core Runtime, Application

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 4

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 06, 2017 using build 2016.0.01.298513
See blog article http://adamcameroncoldfusion.blogspot.com/2012/11/applicationcfc-set-mappings-dont-work.html. It has code and results.

Bottom line, mappings set in Application.cfc are not available in onApplicationEnd().  In CF8 they weren't available in onSessionEnd() either: this has been fixed, but it's still bung in onApplicationEnd() in CF9 and CF10.

See people having problems with this here:
http://stackoverflow.com/questions/10949762/onsessionend-has-different-rootpath-then-my-running-application/13213081
And here:
http://stackoverflow.com/questions/12286622/when-the-onapplicationend-event-fires-it-can-no-longer-resolve-the-mappings-i-ha

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3358817

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

I think Adam Camerons blog article covers it. Think of the time wasted finding this bug for yourself.
Vote by External U.
17307 | November 03, 2012 06:24:03 PM GMT
I too have encountered this bug with CF 9,0,1,274733 Enterprise on Windows 2008 R2 servers. I will add that my code has one Application.cfc in the webroot and another in a sub-folder of that webroot. The same code referencing a mapping in OnApplicationEnd will work fine in the sub-folder but not in the webroot.
Vote by External U.
17308 | November 05, 2012 08:27:15 AM GMT
Add proper testcases like applicationStop. Please modified the testcase based on applicationstop.. rather than application timeout.
Comment by Awdhesh K.
17301 | February 26, 2014 12:24:52 AM GMT
We assumed that onApplicationEnd can be fired at any time, and not just in the context of an executing request. So to play it safe, application scope or better say FusionContext is not being passed. Need to relook into onApplicationEnd call and make the required changes. Too late for Cf11 GMC, will revisit later.
Comment by Awdhesh K.
17302 | March 03, 2014 03:49:01 AM GMT
Have also had issues with this.datasource being missing during the end of the application lifecycle. Good time to get this into CF12 before it ships aye.
Vote by External U.
17309 | November 12, 2015 08:12:59 AM GMT
So to confirm: you will now reopen this and back-port the fix into CF10 & 11, right?
Comment by External U.
17303 | November 12, 2015 08:31:28 AM GMT
Have also had issues with the application property this.datasource not being available when calling aplicationStop() with CF11.
Comment by External U.
17304 | November 14, 2015 12:41:39 PM GMT
+1 - Per-app settings (such as mappings and data source) should be available in onApplicationEnd(), but aren't. Verified in CF10 Update 15 (build 10,292620) and CF11 Update 5 (build 11,0,05,293506).
Vote by External U.
17310 | November 15, 2015 01:03:08 AM GMT
Hi Awdhesh, Since per-app settings should be available in onApplicationEnd(), could you please re-open this ticket? Thanks!, -Aaron
Comment by External U.
17305 | November 15, 2015 01:05:35 AM GMT
Verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
17306 | August 06, 2017 12:33:39 AM GMT