Confluence DC won't start after upgrade with error : Invocation of init method failed; nested exception is java.lang.ClassCastException

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform Notice: Cloud, Server, and Data Center - This article applies equally to all platforms.

Platform Notice: Data Center Only - This article only applies to Atlassian products on the data center platform.

Summary


Confluence DC will not start after upgrade with error: Invocation of init method failed; nested exception is java.lang.ClassCastException

Environment

Confluence 7


Diagnosis

When upgrading Confluence from 7.4.11 to 7.13.2, after the upgrade has been completed, Confluence will not start and the above error will be noted in the UI. The full error stack might look something like this:

Error Message
xxxx-xx-xx xx:xx:xxx ERROR [Catalina-utility-x] [ContainerBase.[Standalone].[localhost].[/]] log Exception starting filter [legacyRemoteApiEventPublishingFilter]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheConfigManager' defined in URL [jar:file:/<confluence-install>/confluence/WEB-INF/lib/confluence-cache-ehcache-7.13.2.jar!/cacheProviderContext.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: class com.atlassian.cache.ehcache.DelegatingCachedReference cannot be cast to class com.atlassian.cache.Cache (com.atlassian.cache.ehcache.DelegatingCachedReference and com.atlassian.cache.Cache are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @1301b96f)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1769)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:866)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at com.atlassian.spring.container.ContainerContextLoaderListener.contextInitialized(ContainerContextLoaderListener.java:32)
at com.atlassian.confluence.setup.ConfluenceBootstrappedContextLoaderListener.contextInitialized(ConfluenceBootstrappedContextLoaderListener.java:40)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4716)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassCastException: class com.atlassian.cache.ehcache.DelegatingCachedReference cannot be cast to class com.atlassian.cache.Cache (com.atlassian.cache.ehcache.DelegatingCachedReference and com.atlassian.cache.Cache are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @1301b96f)
at com.atlassian.cache.impl.AbstractCacheManager.getCache(AbstractCacheManager.java:177)
at com.atlassian.cache.impl.AbstractCacheManager.getCache(AbstractCacheManager.java:135)
at com.atlassian.cache.impl.AbstractCacheManager.getCache(AbstractCacheManager.java:114)
at com.atlassian.confluence.cache.ehcache.EhCacheManager.getCache(EhCacheManager.java:182)
at com.atlassian.confluence.cache.ehcache.EhCacheConfigManager.reconfigureCacheFromConfig(EhCacheConfigManager.java:69)
at com.atlassian.confluence.cache.ehcache.EhCacheConfigManager.reconfigureCaches(EhCacheConfigManager.java:54)
at com.atlassian.confluence.cache.ehcache.EhCacheConfigManager.afterPropertiesSet(EhCacheConfigManager.java:41)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1828)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1765)
... 25 more


Cause

There could be some conflict with the cache-settings-overrides.properties for the upgraded Confluence.

Solution

Delete this file and restart the instance :  

  • <home-directory>/shared-home/config/cache-settings-overrides.properties  if you run Confluence on a single server.
  • <shared-home>/config/cache-settings-overrides.properties if you run Confluence in a cluster. 


Last modified on Jan 21, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.