当OnApplicationEnd事件触发时,它不能再解析我在Application.cfc中定义的映射 [英] When the OnApplicationEnd event fires it can no longer resolve the mappings I have defined in Application.cfc

查看:319
本文介绍了当OnApplicationEnd事件触发时,它不能再解析我在Application.cfc中定义的映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行ColdFusion 9,0,1,274733,其中的修补程序2应用于Windows 2008 Server 64位与IIS。



我写了一个cfc处理日志(用户审计)到数据库表。基本上,我在请求周期中的不同点调用这个cfc。在应用程序启动,请求结束,应用程序结束和发生错误时。这一切都可以很好地工作,直到应用程序过期。



这里是一些相关的部分从我的Application.cfc。
我定义了一个映射到cfc的位置在任何功能之外,像这样:

  this.versionfolder =version1 ; 
this.mappings [/ modules] =C:\Webroot\folder\#this.versionfolder#;然后在上述应用程序事件中,我可以这样调用我的日志cfc:


$ b

$ b

 < cfinvoke component =/ modules / LogItmethod =Store/& 

这会正常工作,直到应用程序过期。当代码在OnApplicationEnd方法中为记录模块触发我的cfinvoke时,会收到此错误:

 消息:找不到ColdFusion组件或接口/模块/ LogIt。 
详细信息:确保名称正确,并且组件或接口存在。

我知道cfc存在,它已经在整个应用程序的生命周期中以相同的方式调用它。有没有其他人看到这个行为?



在这里抛出一个扳手,我遇到这个问题的应用程序位于web根。我有另一个应用程序,运行在同一个服务器上,它位于此应用程序的一个子文件夹(他们有不同的应用程序名称)。我使用完全相同的逻辑在Application.cfc引用相同的日志cfc通过该应用程序的映射,它在应用程序结束正常工作。我很抱歉,在这个特定的场景中找不到任何在线的东西。



要清楚,我的应用程序在web根失败,每次在应用程序结束。我的应用程序在子文件夹中每次工作。不确定这是否相关,但Web根应用程序在子文件夹应用程序之前启动(访问)。虽然我只测试打击web根应用程序,它仍然失败。我还尝试使用点表示法作为组件名称,但它仍然失败。

解决方案

我发现另一个问题在这里提出了同样的问题



我的发现是有一个但是在CF8-10中导致Application.cfc集合映射不工作在onApplicationEnd()(也不是在CF8中的onSessionEnd())。解决方法是在CFAdmin中设置映射。没有太大的解决方法,恐怕。


I am running ColdFusion 9,0,1,274733 with hotfix 2 applied on a Windows 2008 Server 64-bit with IIS.

I have written a cfc to handle logging (user auditing) to a database table. Basically I call this cfc at different points during the request cycle. On application start, on request end, on application end and when errors occur. It all works perfectly well until the application expires.

So here are some relevant parts from my Application.cfc. I am defining a mapping to the cfc's location outside of any cffunction like so:

this.versionfolder="version1";
this.mappings["/modules"]="C:\Webroot\folder\#this.versionfolder#";

Then in the aforementioned application events I can call my logging cfc like so:

<cfinvoke component="/modules/LogIt" method="Store" />

This works fine until the application expires. When the code fires my cfinvoke for the logging module in the OnApplicationEnd method I get this error:

Message: Could not find the ColdFusion component or interface /modules/LogIt.  
Detail: Ensure that the name is correct and that the component or interface exists.  

I know that the cfc exists it has been calling it the same exact way throughout the application's life span. Has anybody else seen this behavior?

To throw a wrench at this, the application that I am having this problem with is located in the web root. I have another application, running on this same server, which is located in a sub-folder of this application (they have different application names). I am using the exact same logic in that Application.cfc referencing the same logging cfc via that application's mapping and it works fine on application end. I am stumped and have not been able to find anything online about this specific scenario.

To be clear, my application in the web root fails every time on application end. My application in the sub-folder works every time. Not sure if this is relevant but the web root application is started (accessed) before the sub-folder application. Although I have tested only hitting the web root application and it still fails. I have also tried using dot-notation for the component name but it still fails.

解决方案

I just did some research into this because I spotted another question here asking much the same thing.

My findings were that there's a but in CF8-10 that result in Application.cfc-set mappings do not work in onApplicationEnd() (nor indeed in onSessionEnd() in CF8). the work around is to set the mappings in CFAdmin. Not much of a workaround, I'm afraid.

这篇关于当OnApplicationEnd事件触发时,它不能再解析我在Application.cfc中定义的映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆