Application Link page erroring with NullPointerException or IllegalStateException in Bamboo

Platform Notice: Data Center Only - This article only applies to Atlassian products 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

When Creating or Viewing Application Links a HTTP 500 Internal Server error occurs at <bamboo-baseURL>/plugins/servlet/applinks/listApplicationLinks with one of the following exceptions:

NullPointerException

1 2 3 4 5 6 com.atlassian.templaterenderer.RenderingException: 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 66, column 20] at com.atlassian.templaterenderer.velocity.one.six.internal.VelocityTemplateRendererImpl.render(VelocityTemplateRendererImpl.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)

IllegalStateException

1 2 3 4 5 6 com.atlassian.templaterenderer.RenderingException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getOrphanedTrustCertificates' in class com.atlassian.applinks.ui.velocity.ListApplicationLinksContext threw exception java.lang.IllegalStateException: adminConfig.currentApplication is not properly initialized! at com/atlassian/applinks/ui/admin/common_header.vm[line 11, column 20] at com.atlassian.templaterenderer.velocity.one.six.internal.VelocityTemplateRendererImpl.render(VelocityTemplateRendererImpl.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606)

Cause

Cause 1 - NullPointerException:

An Application Link has become corrupted in the database, possibly due to deletion and recreation.

Cause 2 - IllegalStateException: adminConfig.currentApplication is not properly initialized!

Likely misconfiguration in the hosts file.

Resolution

Cause 1 - NullPointerException:

  1. Shutdown the Bamboo instance.

  2. Connect to the Bamboo database and execute the following SQL queries:

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

    The following queries will remove all application links, even those that are working correctly. So, if you have more than application integrated with Bamboo, try to remove the links from the UI and contact support for more help.

    1 2 3 4 5 DELETE FROM trusted_apps_ips; DELETE FROM trusted_apps_urls; DELETE FROM trusted_apps; DELETE FROM bandana WHERE bandana_key LIKE '%applink%'; DELETE FROM bandana WHERE bandana_key LIKE '%com.atlassian.oauth%';
  3. Edit the <bamboo-home>/xml-data/configuration/administration.xml file and remove the entire <currentApplication> tag, if it exists. For example, delete the lines below:

    1 2 3 4 5 <currentApplication> <applicationId>C0A80F180131E4494C2071A449684E94</applicationId> <publicKey>MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgH2SbSdLy4vKr/A0zeAO$</publicKey> <privateKey>MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCAfZJtJ0vLi8q$</privateKey> </currentApplication>
  4. Restart the Bamboo instance.

  5. Go to the other application(s) you want to link to Bamboo and remove any application links related to Bamboo.

  6. Try to configure the the Application Link between the other application(s) and Bamboo again using the correct authentication method, which depends on the user base.

Cause 2 - IllegalStateException: adminConfig.currentApplication is not properly initialized!

Ensure you have configured /etc/hosts (Linux) or C:\Windows\System32\drivers\etc\hosts (Windows):

  1. Run the following command from a Terminal:

    1 2 3 4 5 # check your $HOSTNAME echo $HOSTNAME # try to ping $HOSTNAME ping $HOSTNAME
  2. If it returns "ping: cannot resolve <hostname>: Unknown host" then add an entry into your /etc/hosts file. For that edit /etc/hosts file and add following:

    1 2 127.0.0.1 localhost 127.0.0.1 <hostname>
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.