Skip to main content
Participating Frequently
April 5, 2013
Question

Application.cfc stopped rendering

  • April 5, 2013
  • 1 reply
  • 874 views

CF10  Local Dev MAC machine. Built in server.

Nothing has changed in my Application.cfc.

Cleared cache via admin pages,

Changed Application.cfc/Application.cfm lookup order to all three settings.

Restarted Server and computer several times.

Changed Name of Application.cfc to 1Application.cfc and back.

My pages are not seeing THIS.Datasource and if just try to output This.Name on blank page I get "Element NAME is undefined in THIS".

I'm having the same issue as this post. But the fix isn't working for me.

coldfusion application.cfc not found

Not sure what/how do trouble shoot further.

This topic has been closed for replies.

1 reply

Inspiring
April 5, 2013

Are you outputting the THIS.name from one of the Built-in Function's methods or are you outputting it from another page?

THIS scope is referencable from the component, so if a page is trying to call it.

In the onApplicationStart(), do:

<cfset APPLICATION.datasource = THIS.datasource />

And then on the page that is referencing the variable, have it use APPLICATION.datasource instead.

Participating Frequently
April 5, 2013

I'm trying to call This.Name from a .cfm page.

I added the <cfset APPLICATION.datasource = THIS.datasource /> and no luck.  I even tried

<cfset APPLICATION.datasource = "MyDatabase" /> in OnApplicationStart.

Restarted Server

When I tried to output APPLICATION.datasource and still get similar results

APPLICATION.datasource is undefinded.

Inspiring
April 5, 2013

Have you given your application a name?

<cfset THIS.name = 'testapp' />

If your application successfully started and you change some code in the onApplicationStart(), it will not execute unless manually called or having restarted the application.