onSessionEnd does not respect per-app mappings?


onSessionEnd does not respect per-app mappings?

Posted by Luis Majano
Jul 25, 2008 00:00:00 UTC
I have been breaking my head on this one and I can reproduce something. Maybe I am missing something, but I do not believe my per-application mappins in cf8 are working in combination with onSessionEnd(). I created a very simple test and wallah, failure.

Application.cfc - I setup my timeout to 2 seconds, so I can see the onSession end errors come up quicker.

Then I have an index file with the following:

This is mappings Test.

I execute the page, the page executes the component and dumps it correctly. After two seconds I fire up the cf admin and this is what the logs say:

OnSessionEnd : coldfusion.runtime.CfJspPage$NoSuchTemplateException: Could not find the ColdFusion Component or Interface coldbox.system.beans.requestContext.

Now, if I am totally wrong on this one, please comment. However, I do believe the correct behavior would be that onSessionEnd() would respect my per-application mappings. Do you agree?

To solve this, I have to actually create a CF Mapping in the administrator and then it works. But it gets weirder!! Let's say my application is not in the root but here:

http://localhost/testing/appmappingTest/index.cfm

I placed a cfc under /testing/cfc/requestContext.cfc. I then modified the code to use this create statement:

And again, it breaks, so it can do absolute references to cfc's either. I moved it to inside the test application and then it works. So there you go, I am totally confused in this behavior. Any comments??

 


Sami Hoda

That is pretty weird. Subscribing... will take a look at what we do also.

Brian Kotek

Just a small grammar note Luis: it's "voila" not "wallah". ;-)

Luis Majano

@Brian That really made me laugh man!!! My latin roots kick in once in a while. :)

That was a true Salvadorean Slang

Ben Nadel

If the SESSION and APPLICATION scopes are getting passed to the OnSessionEnd() and OnApplicationEnd() methods, then maybe this makes sense. These functions are being triggered as if they were firing outside of the actual application (hence the passage of scopes).

If you can't directly refer to the THIS scope within the function, then changes are "THIS.Mappings" will also fail to work.

Just guessing, but this might not be a bug - it might just be an inherent trade-off of the ColdFusion event model architecture.

Luis Majano

ACtually, the this scope is available, and you can even log all the mapping. I can instantiate components with paths that are only from the directory where Application.cfc down in the hierarchy.

So the problem is accessing per-app mappings and also absolute paths on cfc instantiations. In my eyes, this is a bug in CF

Ben Nadel

@Luis,

If the THIS scope is available, then I agree that it is a bug.

Site Updates

Entry Comments

Archives

Entries Search