Strange error about missing class in jira plugin

I am trying to add a new tab to the view issue screen in jira using a plugin. Code is below. The plugin compiles fine but gives the error below. I have tried compiling with both Java 8 and Java 11 using the latest SDK and Jira 8.5.0 set for the jira version for jira api dependency in the pom.xml. The code is similar to the source for the comment tab in Atlassian source. I am installing the plugin on jira data center version 8.5.4. I can’t figure out why when I go to a jira with the tab it can’t find the GenericMessageAction class which appears to be part of the API but I could be mistaken. Any ideas on what this might be? I have spent hours trying to figure this out.

[c.atlassian.ozymandias.SafePluginPointAccess] A LinkageError indicates that plugin code was compiled with outdated versions. Unable to run plugin code because of ‘java.lang.NoClassDefFoundError - com/atlassian/jira/issue/tabpanels/GenericMessageAction’.
2020-09-02 08:42:41,643-0700 http-nio-8086-exec-7 ERROR dale.miller 522x1593x1 dmvzrq 64.124.173.190,10.52.238.7,127.0.0.1 /browse/XOGLOBAL-1294 [c.a.j.plugin.issuetabpanel.IssueTabPanelInvokerImpl] Exception thrown while trying to call getActions() for

pom.xml dependency definition

    <dependency>
        <groupId>com.atlassian.jira</groupId>
        <artifactId>jira-api</artifactId>
        <version>${jira.version}</version>
        <scope>provided</scope>
    </dependency>
    <!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API. -->
    <!-- This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x -->
    <dependency>
        <groupId>com.atlassian.jira</groupId>
        <artifactId>jira-core</artifactId>
        <version>${jira.version}</version>
        <scope>provided</scope>
    </dependency>

<properties>
    <jira.version>8.5.0</jira.version>
    <amps.version>6.2.6</amps.version>
    <ao.version>1.2.0</ao.version>
    <sal.version>3.0.3</sal.version>
    <template.version>1.3.1</template.version>
    <axis2.version>1.6.2</axis2.version>
    <log4j.version>1.2.16</log4j.version>
    <maven.version>3.2</maven.version>
    <atlassian.spring.scanner.version>2.0.0</atlassian.spring.scanner.version>
    <plugin.testrunner.version>1.2.3</plugin.testrunner.version>
    <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
</properties>

Tab implementation code

package com.workday.jira.integration.casetab;

import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.tabpanels.GenericMessageAction;
import com.atlassian.jira.plugin.issuetabpanel.AbstractIssueTabPanel3;
import com.atlassian.jira.plugin.issuetabpanel.GetActionsRequest;
import com.atlassian.jira.plugin.issuetabpanel.IssueAction;
import com.atlassian.jira.plugin.issuetabpanel.ShowPanelRequest;
import com.atlassian.jira.util.EasyList;
import com.workday.jira.integration.json.CaseInfo;
import com.workday.jira.integration.rest.RestClient;
import com.workday.jira.integration.salesforce.SalesforceLinkGlobalId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Lists;

import java.util.Collections;
import java.util.List;

public class CaseTabPanel extends AbstractIssueTabPanel3 {

private RestClient restclient;
private static final Logger log = LoggerFactory.getLogger(SalesforceLinkGlobalId.class);

public CaseTabPanel( RestClient restClient) {
    this.restclient = restClient;
}

@Override
public boolean showPanel(ShowPanelRequest showPanelRequest) {
    return true;
}

@Override
public List<IssueAction> getActions(final GetActionsRequest request) {
    final List<IssueAction> caseinfoActions = getCaseInfo(request);

    if (caseinfoActions.isEmpty()) {
        log.debug("Actions is empty");
        IssueAction action = new GenericMessageAction("first");
        //            IssueAction action = new GenericMessageAction(descriptor.getI18nBean().getText("viewissue.nocases"));
        return Collections.singletonList(action);
    }
    return caseinfoActions;
}

private List<IssueAction> getCaseInfo(final GetActionsRequest request) {
    final Issue issue = request.issue();
    final List<CaseInfo> caseinfoForIssue;
    final int totalCases;

    if(issue != null) {
        log.debug("Pulling cases for tab panel");
        List<CaseInfo> caseInfoForIssue = restclient.getCaseInfoPopupRequest(issue.toString());
        totalCases = caseInfoForIssue.size();
        final List<IssueAction> caseinfoActions = Lists.newArrayListWithCapacity(0);
        for( final CaseInfo caseItem : caseInfoForIssue) {
            log.debug("caseInfoList is not null");

// caseinfoActions.add("");
}
return caseinfoActions;
} else {
log.debug(“Issue is null in request”);
return null;
}
}
}

1 Like

Maybe reformatting and rewording your question could help you get more answers.
My thought would be that you’re somehow mismatching versions between. Make sure you are consistent in all your versions, unfortunately I could not find an easy to follow guide for it.
Check this thread from 2018 out.

GenericMessageAction is available in jira-api-7.13.0.jar. No idea if it is available with the new jira versions. As I am using Jira-version 7.13.0, I don’t have any problems with the issuetabpanel. @DaleMiller Please let us know if this problem is specific to new-versions, so that we are aware of this when we update our plugin…Thanks