Confluence won't start post upgrade with error 'Invocation of init method failed'
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
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:
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.