Confluence DC won't start after upgrade with error : Invocation of init method failed; nested exception is java.lang.ClassCastException
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
Confluence DC will not start after the upgrade with the error: Invocation of init method failed; nested exception is java.lang.ClassCastException
環境
Confluence Data Center
診断
When upgrading Confluence, 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:
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
原因
There could be some conflict with the cache-settings-overrides.properties for the upgraded Confluence.
ソリューション
Option 1
Verify if the cache-settings-overrides.properties file contains the below class :
cache.maxEntriesLocalHeap.com.atlassian.confluence.plugin.CachingPluginStateStore=2
If the above class is present in the cache-settings-overrides.properties file, update the above record 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
オプション 2
Delete the cache-settings-overrides.properties file and restart the instance :
<home-directory>/shared-home/config/cache-settings-overrides.properties
if you run Confluence on a single server.- Confluence をクラスターで実行している場合は
<shared-home>/config/cache-settings-overrides.properties
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.