tracker issue : CF-3346123

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

[ANeff] Bug for: unhelpful restpath conflict exception message

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 10/14/2012

Components: REST Services

Versions: 2016,11.0,10.0

Failure Type: Unspecified

Found In Build/Fixed In Build: Final /

Priority/Frequency: Trivial / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

The restpath conflict exception message is unhelpful. Please consider this setup:

C:\inetpub\wwwroot\Application.cfc
C:\inetpub\wwwroot\Restservice.cfc
C:\inetpub\wwwroot\Restservice2.cfc
C:\inetpub\wwwroot\more\Restservice3.cfc
C:\inetpub\wwwroot\more\Restservice4.cfc

Application.cfc contains:
-------------------------
component {
  THIS.name = "TestRest";
  THIS.mappings["/mymapping"] = expandPath("./");
  THIS.restSettings.skipCFCWithError = true;
  public boolean function onRequestStart() {
    restInitApplication("/mymapping", "RestTest");
    return true;
  }
}

All 4 Restservice CFC's contain the following (same restpath "foo" in each - which, of course, is invalid):
--------------------------------
<cfcomponent rest="true" restpath="foo">
  <cffunction name="sayHello" access="remote" returntype="string" httpmethod="get">
    <cfset var rest = "Hello World" />
    <cfreturn rest />
  </cffunction>
</cfcomponent>

When running the app, the following exception is thrown:
-----------
Application RestTest could not be initialized.

Reason: Conflicting URI templates. The URI template /foo for root resource class more.Restservice4 and the URI template /foo transform to the same regular expression /foo(/.*)?Conflicting URI templates. The URI template /foo for root resource class more.Restservice4 and the URI template /foo transform to the same regular expression /foo(/.*)?Conflicting URI templates. The URI template /foo for root resource class more.Restservice4 and the URI template /foo transform to the same regular expression /foo(/.*)? 
-----------

Issues:
1) It only mentions the last path (more.Restservice4). What about Restservice, Restservice2, and more.Restservice3?
2) Instead of "URI templates" and "URI template", it'd be more helpful to say "restpath values" and "restpath value" (so that the user knows what to check for).
3) It just repeats the same unclear message three times.
4) Lack of space before the word "Conflicting" (all three messages just run together)

Suggested new wording:

-----------
Application RestTest could not be initialized.

Reason: Conflicting restpath values. The following contain a restpath value which transforms to the same regular expression /foo(/.*):
- Restservice.cfc
- Restservice2.cfc
- more/Restservice3.cfc
- more/Restservice4.cfc
-----------

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3346123

External Customer Info:
External Company:  
External Customer Name: itisdesign
External Customer Email:

Attachments:

Comments: