When trying to list application links Confluence throws '(Invocation of method 'getOrphanedTrustCertificates') NullPointerException' error

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

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

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. Shutdown Confluence.
  2. 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>
    tip/resting Created with Sketch.

    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, '/'

  3. 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';
  4. Start Confluence.

  5. Flush all the caches in Confluence Admin >> Cache Statistics

Workaround 2

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. The application link can also be deleted entirely and recreated again.
  2. Shutdown Confluence.
  3. 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.

    tip/resting Created with Sketch.

    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%';
  4. Start Confluence.

  5. Recreate any application links that are needed



Last modified on Dec 25, 2018

Was this helpful?

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