onSessionEnd has different rootpath then my running application

岁酱吖の 提交于 2019-12-12 17:08:14

问题


I've got a service in my applicationScope that returns an custom object.

<cffunction name="getObject" access="public"returntype="com.my.Object">

this is works fine in my application but when i call this function from onSessionEnd like: arguments.ApplicationScope.service.getObject()

I get an error that it cannot find the component or interface.

When i use a expandPath("/") when calling it from the website i get the path c:/websites/project/htdocs

when i call the same from the onSessionEnd i'll get c:/coldfusion8/wwwroot this makes it unable to find the components thats located in c:/websites/project/htdocs/com/my/Object.cfc and throws the errors does anyone know a solution for this maybe my configuration?

Thx.


回答1:


I suspect that at least part of your com.my.Object path is resolved via a ColdFusion mapping set in Application.cfc? If so, these don't seem to exist by the time onSessionEnd() is called. So to work around this, you'll need to create the mapping in CFAdmin instead.

I've confirmed this has been partially resolved in CF9, although the mappings set in Application.cfc still are not available in onApplicationEnd().



来源:https://stackoverflow.com/questions/10949762/onsessionend-has-different-rootpath-then-my-running-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!