Jira Plugins do not work together

Hi community,

I have developed two plugins for Jira (indexing- and identity-connector for a 3p system) and each one of them by itself is working totally fine. However when I try to run them both in a single Jira Application, the one that was installed latest does not work.

The installation is completed without an error, but when I try to access the admin-UI of the plugin (both are using webwork), the UI of the latest plugin does not load because the Action I am using cannot be created due to missing bean references. The following error is logged, where the < * > is a substitute for either “indexing” or “identity”, depending on which plugin is not working:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘de.twt.atlassian.jira.gcs.< * >.administration.action.DefaultAction’: Unsatisfied dependency expressed through constructor argument with index 0 of type [de.twt.atlassian.jira.gcs.< * >.configuration.Configuration]: No qualifying bean of type [de.twt.atlassian.jira.gcs.< * >.configuration.Configuration] found for dependency

Both plugins are using a “DefaultAction”-class which is located in different packages (“de.twt.atlassian.jira.gcs.identity.administration.action” and “de.twt.atlassian.jira.gcs.indexing.administration.action”). In these actions a “Configuration” bean is injected:

@Inject
    public DefaultAction(final Configuration configuration) {
        this.configuration = configuration;
    }

The “Configuration” is an interface with an implementing class at distinct packages “de.twt.atlassian.jira.gcs.identity.configuration.base.DefaultConfiguration” and “de.twt.atlassian.jira.gcs.indexing.configuration.base.DefaultConfiguration”. It is annoted as “@Named” and has the following constructor:

@Inject
public DefaultConfiguration(@ComponentImport final PluginSettingsFactory pluginSettingsFactory) {
        pluginSettings = pluginSettingsFactory.createSettingsForKey(this.getClass().getName());
}

I have tried to rename the “Configuration” for the “indexing” Plugin to “IndexingConfiguration” to avoid naming issues, but still get the error. I have also tried annotating the “Configuration”-Bean with “@Qualifier” and a unique name, but still get the “no-bean-found” error. To me it seems that spring only works for the plugin which is installed first, and it fails for the other one.

I have absolutely no clue why this happens and cannot find anything regarding this issue on the internet. I have made sure that the package-name, the plugin-key and all keys in the “atlassian-plugin.xml” are unique between these plugins.

These are the configurations of the jira-maven-plugin:

<plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>jira-maven-plugin</artifactId>
                <version>8.0.0</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>7.4.2</productVersion>
                    <productDataVersion>7.4.2</productDataVersion>
                    <enableQuickReload>true</enableQuickReload>
                    <instructions>
                        <Atlassian-Plugin-Key>de.twt.atlassian.jira.twt-gcs-jira-< * >-connector</Atlassian-Plugin-Key>
                        <Import-Package>
                            *;version="0";resolution:=optional
                        </Import-Package>
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                </configuration>
            </plugin>

Substitute “< * >” with “indexing” or “identity”.

Again, please note that both plugins are working totally fine when I only install one of them. Only when I install both of them, the one I installed latest is producing the above error.

Any ideas on what I might be doing wrong or missing?

Best regards

There’s a bug/issue (I’m not sure if it’s Jira or Webwork) where the class names used by webwork has to be unique. My suggestion would be to rename any webwork class to include the plugin name. Ie. MyPluginDefaultAction.

I’ll hunt for the bug and link it in here.

1 Like

[JRASERVER-26275] Autowire error when a plugin webwork action class has same name as JIRA webwork action class - Create and track feature requests for Atlassian products. is more than likely what you’re hitting.

3 Likes

Thanks for pointing out the bug - I will try renaming the webwork ressources and retry the installation

Thanks @danielwester, this was indeed the bug I was hitting. I was now able to fix this issue in 5 minutes after investigating the issue for 2 days