[Looking for Charlie's main web site?]

How to solve failing "api" URLs, in CF2016 and 11 (not a problem in CF2018)

Note: This blog post is from 2020. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
If you're trying to run a request against CF 2016 (or perhaps 11), and the URL you're using has a path which starts with /api, you may find that the request fails to run (it may give a blank page). What gives? (It was related to the CF2016 API Manager, not CF's REST services feature.)

And what can you do about it, if you are on CF2016 or 11, and you want to use /api for your URLs? There are are two choices, depending on your needs: in brief, you can either:

  • change your /api folder to a new name (which I realize may not appeal to all to some)
  • or change the CF configuration, to STOP it treating /api specially for the API Manager's use. You would do this by editing two CF config files, urlworkermap.properties and web.xml (but this will break the ability of the API Manager to introspect REST services in CF2016 or CF11, though not CF2018)

TLDR; if you're bold and a risk taker, you can jump to the bottom to see my list of changes to make for that second option. As is often the case, there is risk in making changes in a cavalier fashion. There are various things to consider, and I warn of them below--but the good news is that this is a change that may take only minutes to do, once you've been careful to read about how to do it effectively.

Read on for more, including pros and cons of each choice, what to change and where, why this problem NO LONGER happens from CF2018 onward, and more.

(And if you are not familiar with the CF Enterprise API Manager, which is installed separately from CF, you can read about it here.)

[....Continue Reading....]

Comments
This seems to be a re-occuring theme. They seem to have now done this with /rest instead of /api which was causing my applications to break with an obscure Application SOMETHING could not be found. The specific sequence of files included or processed is: '''' "
"Recurring theme"? I think that may a bit over-stated. I think these are the two that might cause the most grief. :-)

Still, I appreciate how it's bit you.

FWIW, that /rest value can also be changed, just like I share above in my "point 2" (and that's not new, going back to CF10 which introduced it). Indeed, it's documented by Adobe how to do it, but I can understand some may not find it readily. See:

https://helpx.adobe....

where it indicates about the "/rest" url/keyword that:

"This default value can be renamed by revising the context path in web.xml available at cfusion/wwroot/WEB-INF and update the same mapping in uriworkermap.properties file found at config\wsconfig\1."

Here also is a blog post from the Adobe engineer about this back in the CF10 timeframe (2012): https://www.anujgakh...

And I suppose I could/should have at least pointed to that in the post above when I mentioned /rest in passing. Oh well, now I have it here, I hope most who would care to know about it would now find it here. I may revise the post. (It's not really fitting with the title, but it's certainly a very much related tangent.)

But until then, let me know if this works for you or you hit any snags.
Copyright ©2024 Charlie Arehart
Carehart Logo
BlogCFC was created by Raymond Camden. This blog is running version 5.005.
(Want to validate the html in this page?)

Managed Hosting Services provided by
Managed Dedicated Hosting