When trying to list application links Confluence throws '(Invocation of method 'getOrphanedTrustCertificates') NullPointerException' error
Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
While trying to list application links in Confluence Admin >> Application Links, the following stack trace is thrown:
org.apache.velocity.exception.MethodInvocationException: Invocation of
method 'getOrphanedTrustCertificates' in class
com.atlassian.applinks.ui.velocity.ListApplicationLinksContext threw
exception java.lang.NullPointerException at
com/atlassian/applinks/ui/admin/list_application_links.vm[line 80,
column 20]
at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)
The following appears in the atlassian-confluence.log:
2013-07-30 22:30:26,862 ERROR [http-8090-2] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
-- referer: http://localhost:8090/admin/viewgeneralconfig.action | url: /admin/listapplicationlinks.action | userName: root
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getOrphanedTrustCertificates' in class com.atlassian.applinks.ui.velocity.ListApplicationLinksContext threw exception java.lang.NullPointerException at com/atlassian/applinks/ui/admin/list_application_links.vm[line 80, column 20]
at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
at org.apache.velocity.runtime.parser.node.ASTReference.evaluate(ASTReference.java:470)
at org.apache.velocity.runtime.parser.node.ASTNotNode.evaluate(ASTNotNode.java:63)
at org.apache.velocity.runtime.parser.node.ASTAndNode.evaluate(ASTAndNode.java:104)
at org.apache.velocity.runtime.parser.node.ASTExpression.evaluate(ASTExpression.java:62)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:85)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.runtime.directive.Parse.render(Parse.java:263)Cause
The com.atlassian.oauth.serviceprovider.ServiceProviderConsumerStore.allConsumerKeys BANDANAVALUE is corrupted in BANDANA (a table in the Confluence Database).
Workaround 1
Warning: Backup your database before proceeding.
Before running any SQL in this article, create a full backup of your Jira database. This is a database-level operation with no undo other than restoring from backup. Only proceed if you're comfortable running SQL directly against the Jira database, and test on a staging or cloned environment first, wherever possible.
Shutdown Confluence.
Obtain the current BANDANAVALUE for that particular row via this query:
SELECT * FROM BANDANA WHERE BANDANAKEY = 'com.atlassian.oauth.serviceprovider.ServiceProviderConsumerStore.allConsumerKeys';Example of output:
<string>jira%3A5326876/MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnwU6SzPcDiF++cF7MAlyrW0M9CfT3sJaQisUOCKt6wnMpzIHPYpjIYIYY%2BvWP0X++IdJPx8j%2FdXvwdpesLEc%2BDnZdUHonaPF%2FsBeWX2BrKTngYtSLvb++Lme6S%2BG7tF3ODAFpoC8qKEZnflA308SqqA2Tqzg675eo6YaUt3/MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnwU6SzPcDiF++cF7MAlyrW0M9CfT3sJaQisUOCKt6wnMpzIHPYpjIYIYY%2BvWP0X++IdJPx8j%2FdXvwdpesLEc%2BDnZdUHonaPF%2FsBeWX2BrKTngYtSLvb++Lme6S%2BG7tF3ODAFpoC8qKEZnflA308SqqA2Tqzg675eo6YaUt3++7Ystw%2FDQUwIDAQAB</string>Notice that the key itself is appended after the application ID? You will need to remove all values after the application ID, which is marked by the front slash, '/'
Extract the Application ID out of the BANDANAVALUE, and update it this way. Example:
UPDATE bandana SET BANDANAVALUE = '<string>jira%3A5326876</string>' WHERE BANDANAKEY = 'com.atlassian.oauth.serviceprovider.ServiceProviderConsumerStore.allConsumerKeys';Start Confluence.
Flush all the caches in Confluence Admin >> Cache Statistics
Workaround 2
Warning: Backup your database before proceeding.
Before running any SQL in this article, create a full backup of your Jira database. This is a database-level operation with no undo other than restoring from backup. Only proceed if you're comfortable running SQL directly against the Jira database, and test on a staging or cloned environment first, wherever possible.
The application link can also be deleted entirely and recreated again.
Shutdown Confluence.
Run the following SQL commands to clean out all of the application links in Confluence:
This SQL command will delete all application links established in Confluence. If there are other existing links, delete all that can be before running this command and remember to recreate them after running the command.
Create a backup of the database before performing these SQL commands
DELETE FROM BANDANA WHERE BANDANAKEY like 'applinks.admin%'; DELETE FROM BANDANA WHERE BANDANAKEY = 'applinks.global.application.ids'; DELETE FROM BANDANA WHERE BANDANAKEY like 'com.atlassian.oauth%';Start Confluence.
Recreate any application links that are needed
Was this helpful?