Search code examples
coldfusioncoldfusion-8

onSessionEnd has different rootpath then my running application


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.


Solution

  • 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().