cfinclude:模板未找到异常 +符号链接 + CF 9.0.1

发布于 2025-01-03 10:31:57 字数 1094 浏览 1 评论 0原文

我有以下目录结构:

/user1/
/user1/bla.cfm
/index.cfm

并创建了一个名为 users 的目录:

/users/
/user1/
/user1/bla.cfm
/index.cfm

我设置了一个从 /user1/ 到 /users/ 的符号链接(在 Linux 下使用 ln -s) user1/ 并尝试 bla.cfm,效果很好。来自index.cfm:

<CFINCLUDE template="users/user1/bla.cfm" />

经过一些测试,我删除了符号链接(/users/user1/)并将真实目录/user1/移动到/users/user1/。突然,bla.cfm 不允许我包含并抛出模板未找到异常。

设置从 /users/user1/ 到 /user1/ 的符号链接后, 再次工作。我无法在我们的开发服务器上重现这个!?有任何提示如何解决这个问题吗?

顺便说一句,所有用户目录(user2、user3 等)内部都有 bla.cfm - 并且只有 2 个存在上述问题。这些用户似乎很活跃,并且通过符号链接包含了 bla.cfm。这些符号链接及其目标是否缓存在某处?

编辑:

我已经尝试清除 CFAdmin 中的模板缓存。

进一步测试: 来自index.cfm:

expandpath("/users/user1/bla.cfm") -> correct path
fileexists(expandpath("/users/user1/bla.cfm")) -> saying "YES"

但是:

fileexists(expandpath("users/user1/bla.cfm")) -> saying "NO"

I had following directory-structure:

/user1/
/user1/bla.cfm
/index.cfm

and created a directory called users:

/users/
/user1/
/user1/bla.cfm
/index.cfm

I set up a symbolic link (under linux with ln -s) from /user1/ to /users/user1/ and tried to <cfinclude> the bla.cfm which worked good. From index.cfm:

<CFINCLUDE template="users/user1/bla.cfm" />

After some testing I removed the symbolic link (/users/user1/) and moved the real directory /user1/ to /users/user1/. Suddenly the bla.cfm did not let me include and threw a template not found exception.

After setting up the symbolic link from /users/user1/ to /user1/ the <cfinclude> worked again. I cannot reproduce this on our development server!? Any hints how to fix this?

Btw all user-directories (user2, user3, etc.) have a bla.cfm inside - and just 2 are having the problem described above. It seems that those users were active and the bla.cfm was included via the symlink. Are those symlinks and their targets cached somewhere?

EDIT:

I tried already clearing the template-cache in CFAdmin.

Further testing:
from index.cfm:

expandpath("/users/user1/bla.cfm") -> correct path
fileexists(expandpath("/users/user1/bla.cfm")) -> saying "YES"

but:

fileexists(expandpath("users/user1/bla.cfm")) -> saying "NO"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沧笙踏歌 2025-01-10 10:31:57

也许是映射的问题?在最后一个包含中,您使用绝对路径,而在第一个包含中,您使用相对路径。

以下是一些有关映射的链接:
http://www.coldfusionmuse.com/index.cfm?mode=entry&entry=8E676EBA-A0EF-5BB2-1461BEA3C00CC076

http://forums.adobe.com/thread/442033

Coldfusion 映射错误

Maybe it's some issue with mappings? In the last include you're using absolute path, where in the first one you're using relative path.

Here are some links about mappings:
http://www.coldfusionmuse.com/index.cfm?mode=entry&entry=8E676EBA-A0EF-5BB2-1461BEA3C00CC076

http://forums.adobe.com/thread/442033

Coldfusion mapping error

执妄 2025-01-10 10:31:57

您没有指定如何设置“符号链接” - 您的意思是您在 CF Administrator 中创建了映射吗?如果是这样,请检查 /cfusion/lib/ 文件夹中的 neo-runtime.xml 文件并查看是否已正确更新。

You don't specify how you setup a 'symbolic link' - do you mean you created a mapping in CF Administrator? If so, check the neo-runtime.xml file in your /cfusion/lib/ folder and see if has been correctly updated.

埋情葬爱 2025-01-10 10:31:57

重新启动 Coldfusion 服务器实例解决了该问题。

Restarting coldfusion server instance fixed the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文