It's not a bug. When a component extends another component,
it inherits functions from the other component, but it also
overrides any function of the same name.
/Application.cfc
/home.cfm
/calendar/Application.cfc [ extends="Application" ]
/calendar/showDay.cfm
Both Application.cfc files have onApplicationStart() and
onRequestStart()
The root Application.cfc's onApplicationStart() creates the
variable "application.mainObj".
The calendar's Application.cfc onApplicationStart() creates
the variable "application.calendarObj".
If the very first page requested (the one that "starts" the
application) is home.cfm, then onApplicationStart() runs in the
root Application.cfc, "application.mainObj" is created and then
onRequestStart() is called.
If the very first page requested is showDay.cfm, then
onApplicationStart() is called from the Application.cfc in the
calendar folder. "application.calendarObj" is created, but
"application.mainObj" is not and then onRequestStart() is called.
In order to make sure that application.mainObj is created, you have
to check inside onApplicationStart() in the same way I described in
an earlier post for onRequestStart().
<cfif not structKeyExists( application, "mainObj" )>
<cfset super.onApplicationStart() />
</cfif>
Now when onApplicationStart() runs in the calendar folder,
both application.mainObj and application.calendarObj are created.
Then, in the onRequestStart() for the calendar's
Application.cfc, you have to check if application.calendarObj
exists and call its onApplicationStart() if necessary. In the case
that the first page requested was home.cfm, onApplicationStart() is
only ever run from the root Application.cfc. You have to
specifically call the one in the calendar Application.cfc to
execute its code.