tracker issue : CF-3348054

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

[ANeff] Bug for: RestInitApplication("/mymapping", "servicename") breaks REST

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

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

Created: 10/17/2012

Components: REST Services

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final / 283392,283393,283396

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win All

Vote Count: 1

RestInitApplication("/mymapping", "servicename") breaks REST

Repro attached:

1) unzip to C:\inetpub\wwwroot (ex: C:\inetpub\wwwroot\restapp1 & C:\inetpub\wwwroot\restapp2)
2) in browser, go to http://localhost/restapp1 and see output "Hello World from restapp1" (good)
3) in browser, go to http://localhost/rest/news/weather and see output "It will be eleven degrees." (good)
4) in CF Admin, see REST service created w/ Root Path "/mymapping1" and Service Mapping "news". (good)
5) in browser, go to http://localhost/restapp2 and see exception "REST service can not be registered. Directory /mymapping1 provided does not exist." (bad)
    - This message doesn't even make sense b/c restapp2 uses mapping named "/mymapping2" (NOT /mymapping1). Why does the message say "/mymapping1"!?
6) in CF Admin, delete the mymapping1/news REST mapping
7) in browser, go to http://localhost/restapp2 and see output "Hello World from restapp2" (good)
8) in browser, go to http://localhost/rest/news/weather and see output "Lightning bolts will light the sky with splendor." (good)
9) in CF Admin, see REST service created w/ Root Path "/mymapping2" and Service Mapping "news". (good)
10) in browser, go to http://localhost/restapp1 and see output "Hello World from restapp1" (good)
11) in browser, go to http://localhost/rest/news/weather and see output "Lightning bolts will light the sky with splendor." (bad)
12) in CF Admin, see REST service still has Root Path "/mymapping2" and Service Mapping "news". (bad)
13) in CF Admin, delete the mymapping2/news REST mapping
14) in browser, go to http://localhost/restapp1 and see output "Hello World from restapp1" (good)
15) in browser, go to http://localhost/rest/news/weather and see error "HTTP Error 500.0 - Internal Server Error. The page cannot be displayed because an internal server error has occurred." (bad)
16) in CF Admin, see mymapping1/news REST mapping was not created
17) see C:\ColdFusion10\cfusion\lib\neo-jaxrs.xml is empty: "<wddxPacket version='1.0'><header/><data><array length='2'><string></string><struct type='coldfusion.server.ConfigMap'></struct></array></data></wddxPacket>" (bad)
18) in exception.log, see "java.lang.NullPointerException at at coldfusion.rest.RestAppAdapter.getAppName(RestAppAdapter.java:52)"
19) restart CF before repeating steps 2-18

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

Watson Bug ID:	3348054

Keywords:
FixTested


External Customer Info:
External Company:  
External Customer Name: itisdesign
External Customer Email:  
External Test Config: 64-bit Windows 7 Ultimate

Attachments:

  1. October 17, 2012 00:00:00: 1_RestInitApplicationBreaksREST.zip

Comments:

I've isolated this further. Basically, RestInitApplication("/mapping", "servicename") is only allowed for ONE site on the entire server. CF10 only allows ONE REST app on the server to be registered w/ a mapping. The repro is simple: App 1 ----- THIS.name="TestRest1"; THIS.mappings["/mymapping1"] = expandPath("./"); function onApplicationStart() {restInitApplication("/mymapping1", "news1");} function onRequestStart() {if(structKeyExists(URL, "reinit")) {applicationStop();location(url="index.cfm");}return true;} App 2 ----- THIS.name="TestRest2"; THIS.mappings["/mymapping2"] = expandPath("./"); function onApplicationStart() {restInitApplication("/mymapping2", "news2");} function onRequestStart() {if(structKeyExists(URL, "reinit")) {applicationStop();location(url="index.cfm");}return true;} 1) place App 1 at C:\inetpub\wwwroot\restapp1 2) place App 2 at C:\inetpub\wwwroot\restapp2 3) go to http://localhost/restapp1?reinit (initializes App 1's REST app and defines it as mymapping1/news1 in CF Admin) (good) 4) go to http://localhost/restapp2?reinit (throws exception "Directory /mymapping1 provided does not exist.") (bad) - This message doesn't even make sense b/c restapp2 uses mapping named "/mymapping2" (NOT /mymapping1). Why does the message say "/mymapping1"!? 5) in CF Admin, delete the REST mapping 6) go to http://localhost/restapp2?reinit (initializes App 2's REST app and defines it as mymapping2/news2 in CF Admin) (good) 7) go to http://localhost/restapp1?reinit (throws exception "Directory /mymapping2 provided does not exist.") (bad) - This message doesn't even make sense b/c restapp1 uses mapping named "/mymapping1" (NOT /mymapping2). Why does the message say "/mymapping2"!? 8) rinse/repeat
Comment by External U.
17488 | October 17, 2012 03:49:12 PM GMT
We are encountering this problem for an API that works on multiple subdomains.
Vote by External U.
17490 | March 14, 2013 12:01:15 PM GMT
Verified the fix in update 11. Added automated testcase at //depot/qa/cf/regression/coretests/restservices/rest2/Bugs/CF-3348054/ Closing the bug.
Comment by HariKrishna K.
17489 | June 12, 2013 05:20:36 AM GMT