Thursday, September 09, 2010

ORM is not configured for the current application

Working on a little app in ColdFusion 9.  Was consistently getting a phantom ColdFusion error (especially containers loaded by the built-in ColdFusion.navigate function):
ORM is not configured for the current application

Very mysterious, and took a while to troubleshoot.  In my Application.cfc, in the onRequestStart method, there was a <cfset ormreload()> .  I had put it there thinking that while I was doing some development it would be nice to have the ORM reloading all of time as I make changes.  However, it looks like it was interfering with the ORM's sequencing, and on Ajax page loads it was causing ColdFusion to erroneously report back that the ORM was not loaded.  I simply moved the ormReload to onApplicationStart, and the problem seems fixed.


Rob Morris said...

Thanks Neil,

Your post helped us to identify an intermittent problem where, after a server restart, if the first page hit was a page with an AJAX call in our site, it would cause this error. (this is because we do an ORMReload() in this circumstance to pick up dynamically generated ORM class files built by our application).

EPhost said...

Thank you. I was getting this error from time to time wondering what the heck was going on. I wasn't feeling too confident about ColdBox on CF10 as I usually use Railo- but now I see the error of my ways. Totally left this in during development.