Yup, I tried setting "this.mappings" as you suggest and it didn't change 
anything.  

We are getting the strong feeling that no mappings are "applied", even the ones 
configured in CF Admin, until after the top script block has completed.  That 
explains all of the behavior that we see.  

Hmm.. this looks like a relevant bug: 
https://bugbase.adobe.com/index.cfm?event=bug&id=3783403
It is marked "fixed" but it sounds like it isn't released yet 

Thanks
        Mark

-----Original Message-----
From: Dean Lawrence [mailto:[email protected]] 
Sent: Wednesday, October 08, 2014 3:12 PM
To: cf-talk
Subject: Re: CF11 changes to Application.cfc - no mappings defined?


Hmm, that is odd. It may very well be a bug. I don't know for sure if the 
location of where you define the application properties is restricted to the 
top of your Application.cfc or not, but here are two things to try.

Placing the calling of your configuration cfc inside your
onApplicationStart() method:

<cfcomponent name="MyApplication" output="false">
        <cfscript>

        public void function onApplicationStart() {
                tcreateObject("component", 
"cfc.ApplicationSettings").configureAppSettings(app=this);
                this.applicationManager.onApplicationStart();
        }

        public void function onRequestStart() {
                application.applicationManager.onRequestStart();
        }
        </cfscript>
</cfcomponent>

Or add an additional mapping above the call to the config cfc.

<cfcomponent name="MyApplication" output="false">
        <cfscript>

       THIS.mappings["/cfc"]="path-to-cfc-folder";
       createObject("component",
"cfc.ApplicationSettings").configureAppSettings(app=this);

       public void function onApplicationStart() {
                this.applicationManager.onApplicationStart();
        }

        public void function onRequestStart() {
                application.applicationManager.onRequestStart();
        }
        </cfscript>
</cfcomponent>



On Wed, Oct 8, 2014 at 2:39 PM, Gaulin, Mark <[email protected]> wrote:

>
> Hi Dean
> Yes, we defined mappings in the CF Admin.  These mappings all work 
> outside of the top script block, but not in it.
>
> Here's a sketch of what currently works on CF10:
>
> <cfcomponent name="MyApplication" output="false">
>         <cfscript>
>         // All of these settings can be done by the 
> configureAppSettings() call below...
> //      this.name = "App";
> //      this.clientManagement = true;
> //      this.sessionManagement = true;
> //      this.setClientCookies = false;
> //      this.applicationTimeout = createTimeSpan(2, 0, 0, 0);
> //      this.setDomainCookies = true;
>
>         createObject("component",
> "cfc.ApplicationSettings").configureAppSettings(app=this);
>
>         public void function onApplicationStart() {
>                 this.applicationManager.onApplicationStart();
>         }
>
>         public void function onRequestStart() {
>                 application.applicationManager.onRequestStart();
>         }
>         </cfscript>
> </cfcomponent>
>
>
> -----Original Message-----
> From: Dean Lawrence [mailto:[email protected]]
> Sent: Wednesday, October 08, 2014 2:13 PM
> To: cf-talk
> Subject: Re: CF11 changes to Application.cfc - no mappings defined?
>
>
> Mark,
>
> When you say global mappings, are you saying that you created a 
> mapping in the ColdFusion admin? Also, can you maybe share some of 
> your Application.cfc code for us to get a better idea as to what you 
> are trying to accomplish?
>
> On Wed, Oct 8, 2014 at 1:58 PM, Gaulin, Mark <[email protected]> wrote:
>
> >
> > Hi Folks
> > Our single CF11 test server just highlighted a freaky difference 
> > between
> > CF10 and CF11 that has us all puzzled.  (We are running CF11 with 
> > the latest service pack.)
> >
> > It appears that the CF mappings defined in CFIDE (such as "/cfc" -> 
> > root dir for all of our CFC's) are not defined inside the block of 
> > code at the top of Application.cfc (outside of any method in 
> > Application.cfc).  This means we can't instantiate CFC's under the 
> > /cfc directory in that top script block area.
> >
> > We know we can create CFC's in onApplicationStart(), but we 
> > currently use a CFC to set the Application's "this.name" and 
> > "this.setDomainCookies", etc. variables, and I think those can only 
> > be changed right at the top of Application.cfc.
> >
> > Is this a bug or something?  Why would globally-defined mappings not 
> > be available at the top of Application.cfc? (BTW, the 
> > per-Application "this.mappings" are also ignored in that top script 
> > block, so that's not a help either.)
> >
> > Thanks
> >         Mark
> >
> >
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359422
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to