Getting error "Cannot unwrap to requested type" after upgrading Confluence Data Center
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
Confluence fails to start due to missing parameters in the confluence.cfg.xml
file.
環境
Confluence 7.14.x and above
診断
To confirm if you are running into this situation, the following entries can be found in the atlassian-confuence.log
file:
2024-01-10 19:59:13,079 ERROR [Catalina-utility-1] [atlassian.confluence.plugin.BandanaPluginStateStore] load Exception when loading plugins state from the database. Falling back to in memory state.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantedTransactionManager' defined in class path resource [productionDatabaseContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.UnknownUnwrapTypeException: Cannot unwrap to requested type [javax.sql.DataSource]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
...
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.service.UnknownUnwrapTypeException: Cannot unwrap to requested type [javax.sql.DataSource]
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.unwrap(DriverManagerConnectionProviderImpl.java:252)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
...
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
...
...
原因
As part of Atlassian's effort to resolve some performance issues, we have changed the default connection pool provider from c3p0 to Hikari after Confluence 7.14.
An upgrade task will make the required changes during the upgrade. Ocasionally, there can be issues while adding the required Hikari parameters to the confluence.cfg.xml
file. In that scenario, Confluence will fail to start after the upgrade.
ソリューション
The required Hikari parameters can be added manually by following below steps:
- Stop Confluence.
- Back up your
confluence.cfg.xml
file. Edit your
confluence.cfg.xml
file and add the following parameters:... ... <property name="hibernate.connection.provider_class">com.atlassian.confluence.impl.hibernate.DelegatingHikariConnectionProvider</property> <property name="hibernate.hikari.idleTimeout">30000</property> <property name="hibernate.hikari.maximumPoolSize">60</property> <property name="hibernate.hikari.minimumIdle">20</property> <property name="hibernate.hikari.registerMbeans">true</property> <property name="spring.datasource.hikari.registerMbeans">true</property> ... ...
- Start Confluence again.