Error 'cannot be cast to com.google.gson.JsonArray' showing in Confluence logs after upgrading to JIRA 7
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
After upgrading to JIRA 7, the following error appears in the atlassian-confluence.log
:
2015-11-20 10:11:18,412 ERROR [JIRAMetadataPlugin_aggregate:thread-2] [metadata.jira.helper.JiraMetadataErrorHelper] printError The response from one or more JIRA instances cannot be parsed.
– referer: http://confluence.base.url/confluence/dashboard.action | url: /confluence/display/TS/Page+test | userName: admin | action: viewpage | page: 810002
com.atlassian.confluence.plugins.metadata.jira.exception.JiraMetadataException: java.lang.ClassCastException: com.google.gson.JsonObject cannot be cast to com.google.gson.JsonArray
at com.atlassian.confluence.plugins.metadata.jira.aggregate.JiraAggregateProvider.parse(JiraAggregateProvider.java:248)
at com.atlassian.confluence.plugins.metadata.jira.aggregate.JiraAggregateProvider.getDataForSingleApplink(JiraAggregateProvider.java:108)
at com.atlassian.confluence.plugins.metadata.jira.aggregate.JiraAggregateProvider.access$100(JiraAggregateProvider.java:41)
at com.atlassian.confluence.plugins.metadata.jira.aggregate.JiraAggregateProvider$1.call(JiraAggregateProvider.java:92)
at com.atlassian.confluence.plugins.metadata.jira.aggregate.JiraAggregateProvider$1.call(JiraAggregateProvider.java:77)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: com.google.gson.JsonObject cannot be cast to com.google.gson.JsonArray
at com.google.gson.JsonObject.getAsJsonArray(JsonObject.java:178)
at com.atlassian.confluence.plugins.metadata.jira.aggregate.JiraAggregateProvider.parse(JiraAggregateProvider.java:223)
... 8 more
Cause
The Confluence JIRA Metadata Plugin version installed in the Confluence instance is older than 1.7.14, which is the version compatible with JIRA 7.
Resolution
To fix it we just need to update the Confluence JIRA Metadata Plugin:
- Go under your Manage add-ons page in Confluence
- Select All add-ons on the dropbox menu
- Write jira in the search filter
- You will find the Confluence JIRA Metadata Plugin with an Update button available. Click on this button and your plugin will be updated to 1.7.14 (or newer), fixing the issue.