tracker issue : CF-4198411

select a category, or use search below
(searches all categories and all time range)

Calling restInitApplication with isDefault = true fails to reload

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Giancarlo Gomez / Giancarlo Gomez ()

Created: 03/19/2017

Components: REST Services

Versions: 2016

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: 2016.0.03.300466 / 313041

Priority/Frequency: Normal / All users will encounter

Locale/System: / Mac 10.12

Vote Count: 1

Problem Description:
If you call restInitApplication with the option isDefault set to true it errors out instead of refreshing.

I encountered this while testing code for a presentation today. 

Steps to Reproduce:
Use the following code to replicate anywhere:

restInitApplication(expandPath("./"), "rest_demo",{isDefault: true });

Then hit refresh on the page with it and see the error. In my tests I had it in the ApplicationStart function which would fire on a reinit

Actual Result:
Multiple default applications cannot be registered for the default host.

Expected Result:
Rest Service Refreshed

Any Workarounds:
Ran a restDeleteApplication() before it with a try/catch as it fails if it does not exists (1st run)

try { restDeleteApplication(expandPath("./")); } catch (any e) {}



+1 - verified.
Vote by Aaron N.
1061 | March 30, 2017 03:32:03 AM GMT