-
1. Re: CF Mappings CF11 Dev Not Working
BKBK Aug 6, 2014 3:03 PM (in response to pennsyfan)It should work. Do you get an error message?
To debug, run <cfoutput>#fileExists(expandPath('../cfc/yourtest.cfm'))#</cfoutput> in test.cfm, to verify whether the full path actually exists.
-
2. Re: CF Mappings CF11 Dev Not Working
pennsyfan Aug 6, 2014 3:10 PM (in response to BKBK)I returns a value of YES
-
3. Re: CF Mappings CF11 Dev Not Working
pennsyfan Aug 6, 2014 3:20 PM (in response to BKBK)Your debug code returns a value of YES.
The error message is that the mapping does not work, i.e. unable to locate component or interface deptCFC/yourtest.cfm…
Yet the cfdump shows the mapping struct and the path is correct.
-
4. Re: CF Mappings CF11 Dev Not Working
BKBK Aug 7, 2014 12:22 AM (in response to pennsyfan)Are you sure the file test.cfm is not including a second Application file? Test by temporarily copying Application.cfc to the same directory (assuming they are in different directories).
As a follow-up test, temporarily change the application's name (by changing the value of this.name in Application.cfc). This will force the application to restart.
-
5. Re: Re: CF Mappings CF11 Dev Not Working
pennsyfan Aug 7, 2014 6:49 AM (in response to BKBK)Bk,
There are only three files in this test project and they are pictured here:
yourtest.cfm simply returns the current date time:
<cfoutput>Current Date Time Stamp: #now()#</cfoutput>
index.cfm contains a simple cfinclude:
<cfinclude template="/deptCFC/yourtest.cfm" >
Application.cfc is pretty simple straight forward with little code:
<cfcomponent displayname="ApplicationCFC" output="true" >
<cfscript>
this.name = "MyFireTouch_Mapping";
this.mappings['/deptCFC']=ExpandPath('../cfc/');
this.applicationTimeout = createTimeSpan(0,0,0,0);
this.sessionManagement = "false";
</cfscript>
<cfdump var="#this#">
<cffunction name="onApplicationStart" returntype="boolean" output="true">
<cfset application.dsn = "myfiretouchdb">
<cfset application.debugMode = 0>
<cfreturn true>
</cffunction>
<cffunction name="onRequestStart" returntype="boolean" output="false">
<cfargument name="thePage"type="string"required="true">
<cfif isDefined('url.reinit')>
<cfset onApplicationStart()>
</cfif>
<cfreturn true>
</cffunction>
</component>
The applicaiton will reinitialize upon starting everytime so no need to change the name, but i have tried that part too.
This is all the code there is, and it returns an error stating if cannot locate /deptCFC/yourtest.cfm but the dump of the mappings shows a full path to the correct directory:
-
6. Re: CF Mappings CF11 Dev Not Working
BKBK Aug 7, 2014 7:21 AM (in response to pennsyfan)It just might be that the application falters or fails. Seeing the 0 timeout confirmed my instincts.
So, let's rule one thing out, and at least avoid complications: give the application a non-zero timeout. For example, this.applicationTimeout = createTimeSpan(1,0,0,0);
P.S.: As a rule, the Application file should not be used for display. Hence, delete the cfdump.
-
7. Re: CF Mappings CF11 Dev Not Working
pennsyfan Aug 7, 2014 7:44 AM (in response to BKBK)BK,
Giving the application a “non-zero” time out solved the issue.
Thank You, I have been beating my head against the wall for a week now!
Now to see if I can get the rest of the problems to go away, i.e. DSN not defined in APPLICATION etc.
This error and others were all secondary to not being able to map to the cfc folder outside of the app root.
Thanks
Jim
-
8. Re: CF Mappings CF11 Dev Not Working
BKBK Aug 7, 2014 7:53 AM (in response to pennsyfan)Glad to hear. Please kindly mark this as solved. It's the kind of issue to which someone else will be searching for an aswer in future.
-
9. Re: CF Mappings CF11 Dev Not Working
pennsyfan Aug 7, 2014 8:52 AM (in response to BKBK)BK,
I have marked the timeoutspan as the correct answer for my problem thanks for the solution.
Jim


