• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

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?

Views

472

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 21, 2021 Apr 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 

Votes

Translate

Translate
Community Expert ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

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 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 26, 2021 Apr 26, 2021

Copy link to clipboard

Copied

Any news, @Malcom Rynolds ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 26, 2021 Apr 26, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2021 Apr 27, 2021

Copy link to clipboard

Copied

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_0-1619515192383.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 27, 2021 Apr 27, 2021

Copy link to clipboard

Copied

This morning I did not receive the error.  Perhaps it was related to there being no value for applicationTimeout or that we just haven't reached the timeout period yet since it is longer than a day now.

 

this.name was also not set.  I've set it now.  I have refereshed the service in CF admin as you indicated.  I have to do this any time I make a change to application.cfc or any of the API files for that matter.  Still no initial error.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2021 Apr 27, 2021

Copy link to clipboard

Copied

LATEST

I am glad to hear that you're no longer gettting any initial errors. Give it a few days before marking this thread as answered.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation