• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion Builder 2018 - Could not find the included template error

New Here ,
Jun 17, 2019 Jun 17, 2019

Copy link to clipboard

Copied

Hallo,

I installed CFB2018 on my mac and trying to run my application.

In application.cfc i have a <cfinclude template="/adirectoryunderwwwroot/fileincluded.cfm"> and always i get a could not find the template error.

Some informations:

-The code directory is under wwwroot folder

-The path is mapped with a sym link.

-CFB2018 server is Coldfusion+Tomcat version and i changed the context.xml file to allow linking.

-CFB2018 server document root is under wwwroot folder

-When i try to navigate to the path using the browser I can reach that folder (so I think tomcat is correctly setup)

-I passed a chmod 777 on all files under the wwwroot

-I unchecked save class in the server admin console

-I tried with and without mapping in coldfusion and it doesn't change the behaviour.

Do you have any advice?

TOPICS
Builder

Views

797

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2019 Jun 17, 2019

Copy link to clipboard

Copied

Your question and issue raise still more questions, in response:

  1. You say the code is in the wwwroot. Which wwwroot. Do you mean the one in the coldfusion cfusion/wwwroot? Do you realize that that's for accessing it via the built-in web server in CF (port 8500, by default)? Is that what you are USING? Or might you be using Apache?
  2. Why did you create a symlink? What is the actual path and the link path?
  3. Why did you modify the context.xml? You say it was to enable "linking", but what led you to think you needed to do that?
  4. When you refer to "server document root" and "coldfusion+tomcat version", these are things in CF Builder. Are you referring then to running the code from within CFBuilder? Are you able to see the URL being generated? What if you visit the URL (that you think should be "right") from a browser, rather than from within CFBuillder? Does that work?
  5. Could it be that you have CF installed both on your own (in an opt/coldfusion directory) AS WELL AS installed also within the CFBuilder folder? That's an available option. And it may be that within CFB, it's pointing to the latter, while you may be putting code in the former.

Let's see if any of these get you down the road. There are many variables, and this one may be challenging to resolve easily by text this way.


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2019 Jun 18, 2019

Copy link to clipboard

Copied

Thank you Charlie,

here my answers:

1) The code is located under cfusion/wwwroot (/Applications/ColdFusionBuilder2018/ColdFusion/cfusion)

2) I'm trying to adapt the server enviroment (cf11/Suse) where the code is currently developed. There we have apache and cf11 and some folders are mapped with sym links. Sym link "il_shared" path is /Applications/ColdFusionBuilder2018/ColdFusion/cfusion/wwwroot/sharedcode/il_shared

3) Because I wasn't able to navigate from browser to the directory mapped, so (according to the tomcat documentation) I added in context.xml <Resources allowLinking="true"/>. After that I was able to navigate to the mapped folder

4) Yes I'm referring to the CF+tomcat bundle in cfbuilder to run my application and I'm able to navigate to the mapped folder (after enabling allowlinking).

The site I'm trying to launch is located in wwwroot/sites/site1 and the mapped folder is located in wwwroot/sharedcode/il_shared.

The cfbuilder server is started and running on port 8600 and the url I launch is: http://localhost:8600/sites/site1/default.cfm and as I said earlier I can navigate to http://localhost:8600/il_shared​. The error I get is:

Could not find the included template /il_shared/global_application.cfm.

The error occurred in /Applications/ColdFusionBuilder2018/ColdFusion/cfusion/wwwroot/sites/site1/Application.cfc: line 26

26 : <cfinclude template="/il_shared/global_application.cfm">

5) I checked and I've no Coldfusion in opt folder, and to recheck I put a simple .cfm file in the folder I mentioned and, after commenting Application.cfc, It runs as expected.

Thanks in advance for your help.

Massimo

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2019 Jun 18, 2019

Copy link to clipboard

Copied

LATEST

Massimo, thanks for the clarifications. Lots to digest there, and to recommend.

First, now that we can see more clearly the include failure, your problem there is not with CF's built-in (Tomcat) web server and those context.xml changes you made. They affect BROWSING to that /il_shared. They do NOT affect CF doing a CFINCLUDE of it.

For CF to CFINCLUDE that folder, it either needs to be a real folder there or needs a CF Admin (or application) "mapping". Such a mapping tells CF (not the web server) where to map that sort of name (il_shared) when it is NOT a real folder. (I don't know if CF can't or won't read a symlink.)

The fastest solution would be to go into the CF Admin, to its Mappings page, and point il_shared to /Applications/ColdFusionBuilder2018/ColdFusion/cfusion/wwwroot/sharedcode/il_shared.

Another option would be to study how you can also add such mappings INSTEAD at the application level, with a this.mappings in your application.cfc. But you may not need to bother with that, since this is your own machine and likely the only app you need to worry about on it.

Again, the key here is understanding the difference in what you can see in browsing to that il_shared folder vs whether and how CF can CFINCLUDE it.

Finally, I'll note that you refer to how you're trying to "adapt" the setup from another environment which was running CF and Apache. But you are not using Apache on this machine, right? Just note that some of what you do and want to do will act quite differently because of that difference alone. You may want to implement Apache, even though it may seem a complication--at least if you want to have things more in sync with the other instance you're trying to model.

Back to the earlier discussion, I will say also that you may find value in a 2001 article I wrote (yes, hard to believe something from 2001 could still be relevant). I wrote it for the then Adobe Dev Center, which is gone, but I found the article on archive.org:

Macromedia - Finding Your Way with a Mapping

In it, I talk about the difference between various mappings (like CF admin and web server ones and still others). It was from the CF6 era, before application-level mappings were added (in CF7, I think). I also refer there to mappings in CF Studio, which was the precursor to CFBuilder. You may want to consider some of what I said, for the value it may have in mirroring some aspects of CFBuilder configuration, since you are talking about browsing from within that.

Let us know if this (especially my "fastest solution" above gets you going.


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation