Random ObserverCollection Errors

14 views
Skip to first unread message

Dylan Miyake

unread,
Apr 11, 2014, 12:24:29 PM4/11/14
to transf...@googlegroups.com
Hi,

I'm getting random/intermittent errors that read:

Element AFTERNEWOBSERVERCOLLECTION is undefined in a CFML structure referenced as part of an expression.

from

C:\foo\bar\transfer\com\facade\AbstractBaseFacade.cfc , line 207

This seems to happen more frequently when the site is under load.  But I can't for the life of me replicate it at all.  I'm not using any observers, so by observers.cfc is blank.  Could this be causing the issue?  I've attached the AbstractBaseFacade CFC -- I'd be happy to just comment out the observer collections, but don't want to break other stuff in here.

Thanks,

Dylan
AbstractBaseFacade.cfc

Brian G

unread,
Jul 12, 2014, 1:00:08 PM7/12/14
to transf...@googlegroups.com
Dylan,

I have also had these errors.  I'm not sure if they are related to the xmlSearch() thread-safety issues or not, but this code solved the problem for me:

in com/events/EventManager.cfc around line 257:

try {
    // when we frequently run discardAll(), the page then tries to fire afternew events generating:
    // Expression: Element AFTERNEWOBSERVERCOLLECTION is undefined in a CFML structure referenced as part of an expression.
    // should be safe to ignore it as if it doesn't run; I don't think we have any afternew advice anyways
    getObserverCollection(arguments.transfer, arguments.type).fireEvent(event);
} catch (any e) {
    // record in logfile for testing
    writeLog(type="Error", file="transfer-advice-error.log", text="[#e.type#] fireEvent #arguments.type#: #e.message#");
}

You could obviously remove the logging and just silently ignore it (since, if the thing doesn't exist, it can't fire the advice).


Brian
Reply all
Reply to author
Forward
0 new messages