Confluence won't start post upgrade with error 'Invocation of init method failed'

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary


Confluence Data Center won't start after an upgrade to version 8.x due to inconsistent cache override settings.

Error log detail

When upgrading Confluence, after the upgrade has been completed, Confluence will not start and this error will show in the UI:

Error Message (catalina.out)
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 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)
[...]

Fix the cache override settings

There could be a conflict with the cache-settings-overrides.properties file for the upgraded Confluence installation. To resolve this, either edit the cache settings file or delete it to restore the default values.

Edit the cache settings to preserve any cache override customizations

Pull up this file in a text editor:

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

Verify if the cache-settings-overrides.properties file contains this class:  

cache.maxEntriesLocalHeap.com.atlassian.confluence.plugin.CachingPluginStateStore=2 

If the above class is present in the cache-settings-overrides.properties file, update this line to the below class and restart the instance as part of the workaround mentioned in the Bug - CONFSERVER-94958

cache.maxEntriesLocalHeap.com.atlassian.confluence.plugin.CachingPluginPersistentStateStore=2  

Delete the cache settings to restore default values

Delete the cache-settings-overrides.properties file and restart the instance :  

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

Note - The cache-settings-overrides.properties file stores the changes to the default cache size configurations from the UI under the General Configuration > Cache Management screen. Deleting this file changes the cache size configurations to default values in place of the custom values updated from the UI.


Last modified on Mar 21, 2025

Was this helpful?

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