Another unnamed CacheManager already exists in the same VM". I exclude ehcache-core from the hibernate4 dependency but it never works for anything but ehcache-1.0.0
We've been hopelessly stuck on 1.0.0 for like 2 years now.
Can someone please post the magic recipe for using cache-1.1.8 and ehcache-1.0.5 and hibernate4-4.3.8.1?
-Aaron
// cache.region.factory_class = 'org.hibernate.cache.SingletonEhCacheRegionFactory' // Hibernate 3
cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' // Hibernate 4
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/aeb5d739-a755-44ec-831b-51cb9d11df8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,Do the instructions in https://github.com/grails/grails-core/releases/v2.4.5 help at all?// cache.region.factory_class = 'org.hibernate.cache.SingletonEhCacheRegionFactory' // Hibernate 3 cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' // Hibernate 4
I'm currently in the middle of releasing Grails 2.4.5 and Grails 2.5.0.Lari
On 24 Mar 2015, at 22:42, Aaron <lon...@gmail.com> wrote:
So every time a new version of hibernate4 or ehcache comes out, I try to upgrade and every time it fails with "Another unnamed CacheManager already exists in the same VM". I exclude ehcache-core from the hibernate4 dependency but it never works for anything but ehcache-1.0.0
We've been hopelessly stuck on 1.0.0 for like 2 years now.
Can someone please post the magic recipe for using cache-1.1.8 and ehcache-1.0.5 and hibernate4-4.3.8.1?
-Aaron
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/05e5264a-b63c-4362-87f7-11be37c13306%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/F7FF6FE5-4311-491D-A6FD-48EBF9A409D3%40lovtangen.com.
| Error Error executing script DbmGormDiff: net.sf.ehcache.CacheException: Another CacheManager with same name 'grails-cache-ehcache' 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.
The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.ByteArrayInputStream@b9f0d73] (Use --stacktrace to see the full trace)
Best Regards,Ronny Løvtangen
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/05e5264a-b63c-4362-87f7-11be37c13306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
beans {
cacheManager {
shared = true
}
}
beans { cacheManager { cacheManagerName = 'springSecurityCacheManager' } }
beans {
ehcacheCacheManager {
shared = true
}
}
ehcacheCacheManager {
shared = true
}
| Error Error executing script DbmGormDiff: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcacheCacheManager': Unable to determine target bean definition for FactoryBeans of type grails.plugin.cache.ehcache.GrailsEhCacheManagerFactoryBean (Use --stacktrace to see the full trace)
cacheManager {
shared = true
}
| Error Error executing script DbmGormDiff: net.sf.ehcache.CacheException: Another CacheManager with same name 'grails-cache-ehcache' 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.
The source of the existing CacheManager is: InputStreamConfigurationSource [stream=java.io.ByteArrayInputStream@220540af] (Use --stacktrace to see the full trace)
Upgrading cache-ehcache plugin has been a bit of a pain the latest releases. This is my list of workarounds to get cache:1.1.8 and cache-ehcache:1.0.5 working in Grails 2.4.4:1) Exclude ehcache-core dependency of hibernate, workaround for https://jira.grails.org/browse/GPCACHEEHCACHE-10:BuildConfig.groovy:runtime ":hibernate4:4.3.6.1", { // or ":hibernate:3.6.10.18"
excludes 'ehcache-core'
}2) Revert back to using DefaultKeyGenerator so that @CachePut and @CacheEvict works. Was broken by http://jira.grails.org/browse/GPCACHE-21:resources.groovy:import org.springframework.cache.interceptor.DefaultKeyGenerator
beans = {
defaultKeyGenerator(DefaultKeyGenerator)
}Config.groovy:grails.cache.keyGenerator = "defaultKeyGenerator"3) For some reason, if cached object is at least two levels deep, maxElementsInMemory must be set to a value to avoid error:WARN net.sf.ehcache.pool.sizeof.ObjectGraphWalker - The configured limit of 1,000 object references was reached while attempting to calculate the size of the object graph. Severe performance degradation could occur if the sizing operation continues. This can be avoided by setting the CacheManger or Cache <sizeOfPolicy> elements maxDepthExceededBehavior to "abort" or adding stop points with @IgnoreSizeOf annotations. If performance degradation is NOT an issue at the configured limit, raise the limit value using the CacheManager or Cache <sizeOfPolicy> elements maxDepth attribute. For more information, see the Ehcache configuration documentation.Config.groovy:grails.cache.config = {
...cache {
...maxElementsInMemory 1000
}
}I have one application that I haven't been able to upgrade yet. It does have multiple datasources, so I will have a look at switching to the Singleton factory.
Best Regards,Ronny Løvtangen
--
You received this message because you are subscribed to a topic in the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grails-dev-discuss/57bpHvzHH3I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CD8D2545-FA54-4097-BD25-49DB5359CF8D%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/A673766B-7704-48A9-9BB9-8826C51616B1%40gmail.com.