Skip to main content
Malcom Rynolds
Participant
April 21, 2021
Answered

First call to rest api returns error "Application could not be found"

  • April 21, 2021
  • 2 replies
  • 1006 views

I've created a rest API in ColdFusion 2016.  The first time a request is made to the API in the morning will generate an error:
Application (myapp) could not be found. The specific sequence of files included or processed is: ''


All subsequent requests to the API go through without errors after that.  Any idea why I am getting this error?

    This topic has been closed for replies.
    Correct answer BKBK

    Could it then be that this.applicationTimeout (in Application.cfc) is set to 1 day or less? If so, then the error suggests that the application had not fully started before the Rest API started.

    You could then solve this by

    1. Creating a recurring scheduled task with the sole purpose of starting the application beforehand;
    2. Increasing the value of this.applicationTimeout 

    2 replies

    BKBK
    Community Expert
    Community Expert
    April 26, 2021

    Any news, @Malcom Rynolds ?

    Malcom Rynolds
    Participant
    April 27, 2021

    Thank you for the response.  Application timeout is not set.  I've set it to 1 day and 12 hours.  We'll see what happens.  Seems very hard to test this since it only happens first time in the morning.  I wonder if the server is being rebooted over night and it is the first time a rest service is called.

    BKBK
    Community Expert
    Community Expert
    April 27, 2021

    Please confirm that "myapp" is tha value of this.name in Application.cfc.

     

    Yet another idea: open the ColdFusion Administrator. Go to the page Data & Services > REST Services

    You should see a row corresponding to the REST service. Press the button to refresh the service:

     

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    April 21, 2021

    Could it then be that this.applicationTimeout (in Application.cfc) is set to 1 day or less? If so, then the error suggests that the application had not fully started before the Rest API started.

    You could then solve this by

    1. Creating a recurring scheduled task with the sole purpose of starting the application beforehand;
    2. Increasing the value of this.applicationTimeout