NullPointerException in Application links healthcheck causing it to fail occasionally.

Description

Summary

In some cases, after upgrading to Jira 7.11.0 and AppLinks 5.4.5, AppLinksManifestDownloader throws a NullPointerException.

Environment

Linux OS, Jira 7.11.0 (AppLinks 5.4.5), applink configured to Confluence 6.10.X

Steps to Reproduce

We can't reproduce problem locally.

Expected Results

Applinks works without exceptions

Actual Results

The below exception is thrown in the atlassian-jira.log file:

Notes

Exceptions becomes visible after setting logging com.atlassian.applinks package to DEBUG level.

Exception is caused by first parameter to ChainingClassLoader constructor being null (see stack trace above), and that parameter is, currentContextClassLoader, which is initialised by Thread.currentThread().getContextClassLoader().

The docs for the `getContextClassLoader` method say that a null return value is possible:

There are two places in the applinks that currently can break if the class loader is null:

AppLinksManifestDownloader#doDownload, line 157
DefaultApplicationLinkService#createReciprocalLink, line 584

see related

Workaround

No workarounds. A restart may solve the problem for a couple of minutes, but then error reoccurs.

Environment

None

Assignee

Unassigned

Reporter

Nikolay Loboda

Components

Add-on Type

None

Team

None

CC

None

Risk factor

None

Affected Product/s

None

Priority

Major
Configure