Skip to content

Set statistics enabled for EhCache [SPR-11092] #15718

@spring-projects-issues

Description

@spring-projects-issues

Marcin Kamionowski opened SPR-11092 and commented

EhCacheFactoryBean create new cache but does not add to CacheManager.
It cause error when statisticsEnabled is true because Cache.setStatisticEnabled(boolean) checks if it is alive.

Caused by: java.lang.IllegalStateException: The Cache is not alive (STATUS_UNINITIALISED)                                                                                                                
        at net.sf.ehcache.Cache$CacheStatus.checkAlive(Cache.java:4267)                                                                                                                                                                      
        at net.sf.ehcache.Cache.checkStatus(Cache.java:2701)                                                                                                                                                                                 
        at net.sf.ehcache.Cache.getLiveCacheStatistics(Cache.java:3637)                                                                                                                                                                      
        at net.sf.ehcache.Cache.isStatisticsEnabled(Cache.java:3667)                                                                                                                                                                         
        at net.sf.ehcache.Cache.setStatisticsEnabled(Cache.java:3674)                                                                                                                                                                        
        at org.springframework.cache.ehcache.EhCacheFactoryBean.afterPropertiesSet(EhCacheFactoryBean.java:342)                                                                                                                              
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)                                                                                      
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)

Affects: 3.2.5

Issue Links:

Referenced from: commits 6ce2eb9, 6c1f62b

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions