RC1 on session end error

So, I have an onError method in my application.cfc that redirects to my “Call Customer Service” screen. It’s rarely used unless ColdBox has errors getting bootstrapped up.
As part of our release last weekend I added a quick cfmail into it so our web team would if/when errors ever bubbled up that far from our app. I tossed in that code as we were moving the code to our production server.

I was quite surprised when, about an hour or so after we restarted the services on production and were testing (session timeout is about an hour) we started getting dozens of E-mails from the onError method from people’s onSessionEnd firing as their sessions expired. Of course, these threads aren’t tied to an HTTP request so nobody sees them, but since we didn’t previously log the errors in onError, we never knew about them. The errors all say this:

Could not find the ColdFusion Component or Interface master.handlers.ehMain.
Ensure that the name is correct and that the component or interface exists.

(full stack below)

The error is happening as the handlerService tries to create a new handler.

This particular app is in a folder of webroot called “master”. We do not set the appMapping setting, we let ColdBox auto-calculate it.
My sessionEndHandler is “ehMain.onSessionEnd”

Firstly, I’m not sure why this error isn’t being handled like all other errors via logbox, etc.

Secondly, I’m not sure why the component master.handlers.ehMain is not found. We have other events in that handler that work just fine. There seems to be something about onSessionEnd that executes in such a manner that it’s not finding my mappings or something. We have a second site which has the ColdBox app in the web root, and it is throwing the same error (except the error on that site is just looking for “handlers.ehMain”). I even tried running a page with a createObject call for “master.handlers.ehMain” and it worked fine. We don’t really have any code in our onSessionEnd method so I can just take out the setting, but I’m not sure this isn’t a CF or ColdBox bug. Is anyone out there using the onSessionEnd and seeing it work correctly?

Thanks!

~Brad

coldfusion.runtime.CfJspPage$NoSuchTemplateException: Could not find the ColdFusion Component or Interface master.handlers.ehMain.
at coldfusion.runtime.TemplateProxyFactory.getResolvedFile(TemplateProxyFactory.java:1214)
at coldfusion.runtime.TemplateProxyFactory.getTemplateFileHelper(TemplateProxyFactory.java:1387)
at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:1330)
at coldfusion.cfc.ComponentProxyFactory.getProxy(ComponentProxyFactory.java:38)
at coldfusion.runtime.ProxyFactory.getProxy(ProxyFactory.java:65)
at coldfusion.runtime.CFPage.createObjectProxy(CFPage.java:4638)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4483)
at cfHandlerService2ecfc2060316254$funcNEWHANDLER.runFunction(E:\Inetpub\wwwroot\common\coldbox\system\web\services\HandlerService.cfc:50)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471)
at cfHandlerService2ecfc2060316254$funcGETHANDLER.runFunction(E:\Inetpub\wwwroot\common\coldbox\system\web\services\HandlerService.cfc:120)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272)
at cfController2ecfc1915627892$funcRUNEVENT.runFunction(E:\Inetpub\wwwroot\common\coldbox\system\web\Controller.cfc:498)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:453)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:320)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222)
at cfColdbox2ecfc949167675$funcONSESSIONEND.runFunction(E:\Inetpub\wwwroot\common\coldbox\system\Coldbox.cfc:412)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2436)
at coldfusion.runtime.SuperScope.invoke(SuperScope.java:18)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222)
at cfApplication2ecfc317639506$funcONSESSIONEND.runFunction(E:\Inetpub\wwwroot[www.example.com](http://www.example.com)\master\Application.cfc:89)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448)
at coldfusion.cfc.CFCProxyFilter.invokeAppEvent(CFCProxyFilter.java:102)
at coldfusion.cfc.CFCProxyFilter.invoke(CFCProxyFilter.java:43)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.cfc.CFCProxy.doInvoke(CFCProxy.java:257)
at coldfusion.cfc.CFCProxy.invoke(CFCProxy.java:231)
at coldfusion.runtime.AppEventInvoker.onSessionEnd(AppEventInvoker.java:333)
at coldfusion.runtime.SessionTracker.cleanUp(SessionTracker.java:266)
at coldfusion.runtime.SessionTracker.access$000(SessionTracker.java:13)
at coldfusion.runtime.SessionTracker$SessionCleanUpAgent.run(SessionTracker.java:361)
at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:201)
at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)

I beleive i reported this as a cf bug dealing with mappings and how session end and event gateways sometimes loose per app mappings. I would suggest using a strong app mapping setting and are you using per app mappings?

No, we aren’t using per-app mappings. In fact, there isn’t a mapping at all for this to work. Since the CFC path is relative to the web root, no mapping should be required.

Actually, come to think of it-- the issue might be related to the fact that the coldbox framework itself sits outside the web root. Since the onSessionEnd in application.cfc is inherited from coldbox.system.Coldbox (which is outside my web root) I wonder if it is confused about where the webroot is since there is no URL for that request.

~Brad

yep