Skip to main content
Inspiring
March 24, 2013
Question

Resetting the application

  • March 24, 2013
  • 1 reply
  • 1052 views

I've been reading up on CF10's applicationStop() function and something simply isn't clicking as after I use it I get an error that states:

APPLICATION '' DOES NOT EXIST.

And after I remove the code and run the page again, the dump I have shows the old APPLICATION's information (one of the variables in the structure is a 'dateInitialized' which sets the current date into it when the application starts, and it's showing an old date)

I put this code in the APPLICATION.cfc constructor area so that it runs at the beginning of the page load.

I'm assuming my issue here is partly due to where I'm putting the code, but Adobe's page on applicationStop() is not specific as to this.

    This topic has been closed for replies.

    1 reply

    Inspiring
    March 24, 2013

    Instead of describing your code, can you post it?

    --

    Adam

    Inspiring
    March 24, 2013

    Yeah, but in this case it seems like explaining it would be better than cutting and pasting the 1000+ lines of my Application.cfc file.

    application.cfc:

    <cfcomponent

         output="false">

         <cfset applicationStop() />

         <!--- Variables, Methods and other Application.cfc stuff here. --->

    </cfcomponent>

    So basically I added the applicationStop() line, reloaded the page.  Removed it and reloaded the page again, and the application seems to persist rather than being stopped.

    Inspiring
    March 24, 2013

    Well that's a bit obtuse. Obviously not all 1000 lines of the Application.cfc are going to be relevant here, are they? You should be able to pare the code back to what's giving you the problems.

    More reading:

    http://adamcameroncoldfusion.blogspot.co.nz/2012/12/need-help-know-how-to-ask-for-it.html

    And are you telling me you have a call to applicationStop() in your Application.cfc's pseudo-constructor?

    How is that ever supposed to do anything useful, given that code is run on every request..?

    --

    Adam