Confluence returns NullPointerException while creating application link to JIRA

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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.

*Except Fisheye and Crucible

Problem

Confluence returns network error, NullPointerException while creating application link to JIRA. However, JIRA seems to be connected just fine from Confluence.

The following appears in the atlassian-confluence.log

WARN [ajp-nio-8009-exec-3] [applinks.internal.status.DefaultApplinkStatusService] logApplinkError Unrecognized error while attempting to retrieve status of Application Link '877d2179-0ee0-3d5f-826f-40d9d0bf1eee'
 -- referer: https://<CONFLUENCE-SERVER-BASE-URL>/admin/listapplicationlinks.action?applinkCreationStatusLog=%22%5B%7B%5C%22status%5C%22%3A%5C%22inprogress.creation%5C%22%7D%2C%7B%5C%22status%5C%22%3A%5C%22completed.creation.local%5C%22%7D%2C%7B%5C%22status%5C%22%3A%5C%22inprogress.creation.reciprocal%5C%22%7D%2C%7B%5C%22status%5C%22%3A%5C%22completed.creation.reciprocal%5C%22%7D%5D%22&applinkOriginalCreatedId=%22877d2179-0ee0-3d5f-826f-40d9d0bf1eee%22&sharedUserbase=false&applinkConfigInUserAuth=true&applinkConfigInServerAuth=true&applinkConfigInPreAuth=true&applinkConfigOutUserAuth=true&applinkConfigOutServerAuth=true&applinkConfigOutPreAuth=true | url: /rest/applinks/3.0/status/877d2179-0ee0-3d5f-826f-40d9d0bf1eee | traceId: 6882967a70371cc5 | userName: sysadmin

and

ERROR [ajp-nio-8009-exec-7] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service: null
 -- referer: https://<CONFLUENCE-SERVER-BASE-URL>/display/<SPACE-KEY>/<PAGE-NAME> | url: /rest/jiraanywhere/1.0/servers | traceId: 4b56e9c912c374e5 | userName: <USERNAME>
java.lang.NullPointerException
	at com.atlassian.oauth.consumer.sal.PluginSettingsConsumerTokenStore.get(PluginSettingsConsumerTokenStore.java:85)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)

Diagnosis

Environment

  • Both JIRA and Confluence were migrated from Cloud and now running on servers.

Diagnostic Steps

  • Application link was not able to connect even after proxy and SSL was bypassed. 
  • Regardless if Confluence and JIRA are running on the same or different server.

Cause

This issue wasn't caused by the network as shown in the error message. There might be some old OAuth token in the database used in the Cloud instance that's not longer used in servers. These OAuth token needs to be removed and recreated.

Resolution

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  1. Delete any existing application link from both JIRA and Confluence.
  2. Shut down both applications.
  3. View the OAuth Tokens that exist in the database, by running the following query in your Confluence database:

    SELECT * from BANDANA where BANDANAKEY LIKE '%oauth%';
  4. Remove the old OAuth Token by running the following query in your Confluence database :

    DELETE from BANDANA where BANDANAKEY LIKE '%oauth%';
  5. Start up both applications and recreate the application link.

 

Last modified on Sep 28, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.