Skip to main content
linGLIngMaTE
Participant
June 26, 2019
Question

Coldfusion2018: How to setup mapping correctly?

  • June 26, 2019
  • 2 replies
  • 1331 views

These are the steps I use:

1) I created new mapping inside CF Server => Server Settings => Mapping

logical path: /mysite

directory path: /Volumes/drive2/work/mysite

2) I restarted the server

/Applications/ColdFusion2018/cfusion/bin/coldfusion stop && /Applications/ColdFusion2018/cfusion/bin/coldfusion start

3) Using my preferred text editor, I created test.cfm inside /Volumes/drive2/work/mysite with the following contents

<cfdump var="#CGI#">

4) I then tried viewing the new file on my browser via

localhost:8500/mysite/test.cfm

I then get a 404 error. Exact message goes like "coldfusion.runtime.TemplateNotFoundException: File not found: /mysite/test.cfm"

I checked these 2 things:

  1. I verified that /Volumes/drive2/work/mysite  is readable by everyone (755 permission)
  2. I verified that /Volumes/drive2/work/mysite/test.cfm  is readable by everyone (644 permission)

Other than creating the mapping, the other configurations I've changed are:

  1. Created datasource for my app
  2. Enabled debugging/logging but only after I got the first 404 error

Any ideas what I could be doing wrong? or perhaps other settings I should've set? I've added a screenshot of the mappings section below.

Thanks!

This topic has been closed for replies.

2 replies

Community Expert
June 27, 2019

CF mappings aren't going to let you resolve file paths through the web server, which is what you're trying to do here. They only affect CFML tags that use their own file paths, like CFINCLUDE and CFMODULE. You'll need to create a virtual mapping in your web server. Since you're using the CF built-in web server, you'll need to edit a text file for configuration as described here:

Working with Tomcat as the built-in application server | Adobe Developer Connection

I found that, along with some other useful information, from Charlie Arehart's blog post here:

https://www.carehart.org/blog/client/index.cfm/2012/7/23/The-builtin-web-server-in-ColdFusion-10-enabling-it-configuring…

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC
WolfShade
Legend
June 27, 2019

I can only think of two things.

First, make sure the connector is properly set.  Sometimes it will look successful, but logs can indicate otherwise.

Next, look at this SO thread currently with only one answer.  It might help.

HTH,

^ _ ^