RE: [coldbox:7983] Cache is not registered errors

I recently upgraded to build 114 and now the logs are filling up with the Cache is not registered error.
I’ve read the older post on this topic and none seem to address this issue.

Are you sure? Are you injecting references to any part of the CB framework (including the cache manager itself) into any CFC of your own that is living for more than one page request? That’s all it takes to cause this error.

Seems to be saying that the cache named ‘template’ is not registered. But I believe ‘template’ it has been registered as seen below in the CacheBox.cfc that is mapped to in the Coldbox.cfc.

Sure, the “template” cache used to be registered. The issue is that when you reinit the framework, the old cache is “shutdown” and a new one created. Any models you have persisted in session or application that were injected it parts of the framework will still be holding references to the old, defunct cache factory. That is why you need to use a provider like Luis explained in the previous threads so you keep no hard references to the cache. If you have the correct logging configured, you can actually see the cache shutting down when you reinit like so:

“INFO”,“LOGFILE”,“02/04/2011”,“15:37:58”,“coldbox.system.cache.CacheFactory”,“Shutdown of cache factory: 6508553 requested and started.”
“INFO”,“LOGFILE”,“02/04/2011”,“15:38:04”,“coldbox.system.cache.providers.CacheBoxColdBoxProvider”,“CacheBox Cache: TEMPLATE has been shutdown.”
“INFO”,“LOGFILE”,“02/04/2011”,“15:38:08”,“coldbox.system.cache.providers.CacheBoxColdBoxProvider”,“CacheBox Cache: default has been shutdown.”
“INFO”,“LOGFILE”,“02/04/2011”,“15:38:14”,“coldbox.system.cache.CacheFactory”,“Shutdown of cache factory: 6508553 completed.”

That’s where your template cache is going :slight_smile:

Although the logs are filling up with this error, I have not been able to make it happen or capture a stack trace.

Are you not logging the stack trace? Getting the stack will be very helpful in finding out where your stale references to the cache factory are being stored.

Thanks!

~Brad

Hi Brad,
Thanks for answering.
I don’t “think” we are persisting objects past a page request.
Can you share an example of what would do that?

As for logging, I have not been able to figure out how to capture stack trace in the coldbox onException, but we are loging the error and details.

Thanks
Tina