user
11/12/2025, 8:16 PMjava.lang.IllegalStateException: Close not supported from UNINITIALIZED
I am creating the cache beans like this
@Configuration
class EhcacheConfig {
@Autowired
CacheManager cacheManager
@Bean
CacheManager cacheManager() {
log.info('cacheManager() called')
return CacheManagerBuilder.newCacheManagerBuilder().withCache('cache1', ...).withCache('cache2', ...).build(true)
}
@Bean
Cache<String, Integer> cache1() {
return cacheManager.getCache('cache1', String, Integer)
}
@Bean
Cache<String, Integer> cache2() {
return cacheManager.getCache('cache2', String, Integer)
}
I am not seeing the same error happen when running locally with bootRun. Any ideas here?jdaugherty
11/12/2025, 8:22 PMuser
11/12/2025, 8:45 PMjava.lang.IllegalStateException: Close not supported from UNINITIALIZED
at org.ehcache.core.InternalStatus.close(InternalStatus.java:74)
at org.ehcache.core.StatusTransitioner.close(StatusTransitioner.java:81)
at org.ehcache.core.EhcacheBase.close(EhcacheBase.java:575)
at org.ehcache.core.EhcacheManager.removeCache(EhcacheManager.java:213)
at org.ehcache.core.EhcacheManager.close(EhcacheManager.java:629)
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:233)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:798)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:748)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1499)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:707)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1492)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1222)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1183)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:179)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1129)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:510)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:136)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer$SpringBootContextLoaderListener.contextDestroyed(SpringBootServletInitializer.java:266)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4078)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:4688)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:235)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1217)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1206)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:81)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:812)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:235)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1217)
at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1206)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:81)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:812)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:235)
at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:466)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:235)
at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:913)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:235)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:833)
at org.apache.catalina.startup.Catalina.start(Catalina.java:797)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)jdaugherty
11/12/2025, 8:46 PMuser
11/12/2025, 8:49 PMjdaugherty
11/12/2025, 8:50 PMjdaugherty
11/12/2025, 8:50 PMuser
11/12/2025, 8:51 PMjdaugherty
11/12/2025, 8:51 PMuser
11/12/2025, 8:54 PM