Grails ehcache plugin - another unnamed CacheManager already exists in the same VM

I am running the Grails application using ehcache for my 2nd level Cache and it works. I installed plugin ehcacheplugin + cacheand then not. I tried almost all the solutions from the Internet and did not find the solution that I get Another unnamed CacheManager already exists in the same VM.

One of the possible solutions is to install p:shared=truein EhCacheManagerFactoryBean, it works if I use the old plugin "Springcache plugin from grails", but with the new plugin they use a modified version of this manager and the sharing property is not available.

I tried to define a new ehcache.xmlfile, but still can not put inside the new name for this cache manager.

I tried changing the class cache.providerinside mine DataSource.groovyto use each other EhCacheProvider, for example Singleton.

Needless to say, I tested a different name using DSL in different places, but still no luck.

In the end, I use the old spring cache plugin, which is deprecated. Can anyone help?

I am using Grails 2.0.3 and ehcache-core:2.5.3.

+5
source share
4 answers

In the section, hibernate DataSource.groovymake sure your is cache.provider.classupdated:

hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = true
    cache.region.factory_class = 'grails.plugin.cache.ehcache.hibernate.BeanEhcacheRegionFactory' // For Hibernate before 4.0
    cache.region.factory_class = 'grails.plugin.cache.ehcache.hibernate.BeanEhcacheRegionFactory4' // For Hibernate before 4.0 and higher
}

I had the same problem, because my cache.region.factory_classoutdated: net.sf.ehcache.hibernate.EhCacheProvider.

See http://grails-plugins.imtqy.com/grails-cache-ehcache/guide/usage.html

+6
source

, Grails 2.5.x, Config.groovy:

beans {
   cacheManager {
      shared = true
  }
}

.

: https://github.com/grails/grails-core/releases/tag/v2.5.0

+5

-ehcache, . 2-

0

For those who arrive here, they get the same error as the OP, it can be considered that the error can be caused by updating the domain class at runtime (swc hot code), which does not work very well in any version of Grails.

I got into this error with Grails 2.5.4, but with a restart button as the only solution.

0
source

All Articles