Jira fails to start after upgrade due to the ClassCastException ERROR

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

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.

*Fisheye および Crucible は除く

    

要約

Jira fails to to start after an upgrade. When opening the Jira Base URL, the following error is thrown in the UI:

Jira had problems starting up
This page is for Jira administrators. If you're seeing this page, your Jira administrator is probably working to restore the service.

System plugins failed to start: We haven't been able to start all the required system plugins

We couldn't start the following plugins:




環境

Usually occurs from an upgrade from Jira 8.5.x to 8.13.x or 8.20.x

診断

  • When checking the Jira application logs during the startup, the following error is thrown in the UI:

    2021-12-03 14:40:26,017+0100 ThreadPoolAsyncTaskExecutor::Thread 20 ERROR      [c.a.p.osgi.factory.OsgiPlugin] Unable to start the plugin container for plugin 'com.atlassian.plugins.rest.atlassian-rest-module'
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restUriBuilder' defined in URL [bundle://163.0:0/META-INF/spring/atlassian-plugin-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.plugins.rest.module.util.RestUrlBuilderImpl]: Constructor threw exception; nested exception is java.lang.LinkageError: ClassCastException: attempting to castbundle://163.0:1/javax/ws/rs/ext/RuntimeDelegate.classtobundle://163.0:1/javax/ws/rs/ext/RuntimeDelegate.class
  • The Jira application is configured with either JVM startup flag which are used to add classes to OSGi boot class loader as per the KB article Adding classes to OSGi boot class loader (BootDelegation):

    -Datlassian.org.osgi.framework.bootdelegation
    -Datlassian.org.osgi.framework.bootdelegation.extra
  • If Jira is re-started after removing the JVM flags listed above, Jira can startup successfully and the ClassCastException and the system plugin errors disappear.

原因

The JVM flag is incorrectly configured and as a result, several class loaders are trying to load the same class, causing the "ClassCastException" and preventing Jira from starting up all the system plugins. It has been found that a class that is know to cause the exception is com.sun.*. So, if this class was added to the JVM startup flag, it is likely that it is the one causing the exception and the Jira startup failure.

ソリューション

  • オプション 1:
    • Start Jira without using any of the 2 flags below:

      -Datlassian.org.osgi.framework.bootdelegation
      -Datlassian.org.osgi.framework.bootdelegation.extra
  • オプション 2:
    • If you need to keep these flags, try to re-start Jira after removing each class one by one until Jira starts successfully.
    • It will help you determine which class was the culprit (for example com.sun.*)
    • After that, re-add all the classes you removed during your testing, except for the problematic one



最終更新日: 2021 年 12 月 6 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.