tracker issue : CF-3998805

select a category, or use search below
(searches all categories and all time range)
Title:

The CacheManager has been shut down. It can no longer be used.

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Colby Ackerfield / Colby Ackerfield (Colby Ackerfield)

Created: 06/01/2015

Components: Caching

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Windows 7

Vote Count: 3

Listed in the version 2016.0.0.297996 Issues Fixed doc
Problem Description:

After returning to an inactive server (overnight, ~16 hours) cached queries return an error:

The CacheManager has been shut down. It can no longer be used.

Steps to Reproduce:

A simple application with the following two pages exhibits the problem. Request the page query.cfm and then leave the server overnight and attempt to fetch query.cfm in the morning.

Application.cfc:

<cfcomponent>
    <!--- Set up the application. --->
    <cfset THIS.Name = "cachtest" />
    <cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 0, 10 ) /> <!--- tested with this so leaving in here, but couldn't seem to make it fail sooner than overnight --->
</cfcomponent>    

query.cfm:
    <cfquery datasource="MyDataSource" name="LastUpdatedQry" cachedwithin="#CreateTimeSpan(0, 0, 10, 0)#">
         SELECT MAX(l.modStamp) AS maxModStamp,
                GetDate() AS lastChecked
           FROM dbo.MyTable l
    </cfquery>
    


Actual Result:


The CacheManager has been shut down. It can no longer be used.

 
The error occurred in C:/work/webroot/cfcachetest/query.cfm: line 1
1 :     <cfquery datasource="MyDataSource" name="LastUpdatedQry" cachedwithin="#CreateTimeSpan(0, 0, 10, 0)#">
2 :          SELECT MAX(l.modStamp) AS maxModStamp,
3 :                 GetDate() AS lastChecked

Expected Result:

Running code like this shows that the #Application.name#QUERY cache is missing.
    <cfscript>
         cacheManager = createObject('java', 'net.sf.ehcache.CacheManager').getInstance();
        regions = cacheManager.getCacheNames();
        writeDump(regions);
    </cfscript>    

If you attempt to Clear Query Cache Now from the CF Administrator page you get a similar error:

The CacheManager has been shut down. It can no longer be used. 
   
 The error occurred in caching.cfm: line 199
 
-1 : Unable to display error's location in a CFML template.
 
 Resources: •Check the ColdFusion documentation to verify that you are using the correct syntax.
•Search the Knowledge Base to find a solution to your problem.

Browser   Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko 
Remote Address   127.0.0.1 
Referrer   http://127.0.0.1/CFIDE/administrator/settings/caching.cfm 
Date/Time   01-Jun-15 09:24 AM 
 
 Stack Trace  
 at cfcaching2ecfm501570882._factor14(/CFIDE/administrator/settings/caching.cfm:199) at cfcaching2ecfm501570882.runPage(/CFIDE/administrator/settings/caching.cfm:1) 

java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used.
	at net.sf.ehcache.CacheManager.checkStatus(CacheManager.java:1504)
	at net.sf.ehcache.CacheManager.getCache(CacheManager.java:1077)
	at coldfusion.tagext.io.cache.ehcache.GenericEhcache.clearCache(GenericEhcache.java:1223)
	at coldfusion.tagext.io.cache.CacheTagHelper.clearQueryCache(CacheTagHelper.java:633)
	at coldfusion.tagext.io.cache.CacheTagHelper.purgeAllQueryCache(CacheTagHelper.java:614)
	at coldfusion.sql.Executive.purgeQueryCache(Executive.java:1861)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at coldfusion.runtime.StructBean.invoke(StructBean.java:508)
...



Any Workarounds:

I have not found a way short of restarting the server to get the cached queries working again.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3998805

External Customer Info:
External Company:  
External Customer Name: Colby
External Customer Email:  
External Test Config: My Hardware and Environment details:



CF11 with Apache on Windows 7

Attachments:

  1. June 01, 2015 00:00:00: 1_querycacheCF11CFIDE.png
  2. July 10, 2015 00:00:00: 2_cachetest.zip

Comments:

I have this problem as well, sometimes will happen more frequently, i.e. I restart my server in the morning and by late afternoon I have to restart again.
Vote by External U.
7279 | June 01, 2015 11:46:03 AM GMT
I also have this happening. We are migrating an application from CF10 to CF11, and in our development environment have been seeing this. Recently we upgraded one of our production servers to this, but took it out of the load this weekend just in case there were any problems. When I went to add it back into the load this morning, we were getting this error. The server had had no hits over the weekend because it was out of the load balancer. It had previously run 24 hours while in the load without problem. Restarting ColdFusion solved the problem.
Vote by External U.
7280 | June 22, 2015 11:08:16 AM GMT
We are unable to repro this issue. Have waited for more than specified duration, with provided code, but could not find this issue. Please let us know if you have made any cache configuration or any related detail that might help us to repro. Thanks.
Comment by Akhila K.
7273 | July 07, 2015 10:06:31 PM GMT
A new test case has been attached that replicates the error message on a clean install (no config changes other than adding a DSN) of ColdFusion Express 11 with Update 5 within a few minutes. Test relies on: - a DSN named testDSN - a Cities table in testDSN with cityId and cityName columns - a Listings table in testDSN with a modStamp column Place files into wwwroot or web mapped directory Edit files to match your db Start server Request cfcachetest/query.cfm Wait 2 minutes Request cfcachetest/query.cfm - Results in "The CacheManager has been shut down. It can no longer be used." While testing this I also noticed that if I attempt to turn on secondary caching in another cfapplication I get an error like: "Caused by: net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following: 1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary 2. Shutdown the earlier cacheManager before creating new one with same name."
Comment by External U.
7274 | July 09, 2015 04:50:18 PM GMT
The fix for this issue will be provided in next update. Thanks, Akhila.
Comment by Akhila K.
7275 | July 10, 2015 08:45:54 AM GMT
We are unable to repro the secondary caching issue that you have referred in previous note. Please provide more details to repro this case. CacheManager getting shutdown issue is resolved and the fix will be made available in the next update. Thanks.
Comment by Akhila K.
7276 | July 23, 2015 12:41:19 AM GMT
The other reported issue is not reproducible with the patch applied.
Comment by External U.
7277 | July 28, 2015 02:41:51 PM GMT
Closing this bug as both the issues mentioned are resolved with the fix provided.
Comment by Akhila K.
7278 | September 21, 2015 08:11:50 AM GMT