Unresolved constraint in bundle com.atlassian.jwt.plugin

I’m extending the Jira Event Listener demo to also make an HTTP request with a JWT token.

As such, I’m using com.atlassian.jwt.JwtService from jwt-plugin. Unfortunately I’m now getting the following errors on startup.


 ___ FAILED PLUGIN REPORT _____________________

 2 plugins failed to load during JIRA startup.

   'com.example.tutorial.plugins.new-listener-plugin' - 'new-listener-plugin'  failed to load.
           com/atlassian/jwt/JwtService
                   com.atlassian.jwt.JwtService not found by com.atlassian.upm.atlassian-universal-plugin-manager-plugin [174]

           It was loaded from C:\workspace\jira-event-listener\target\jira\home\plugins\installed-plugins\new-listener-plugin-1.0-SNAPSHOT.jar

   'com.atlassian.jwt.jwt-plugin' - 'Atlassian JWT Plugin'  failed to load.
           Cannot start plugin: com.atlassian.jwt.jwt-plugin
                   Unresolved constraint in bundle com.atlassian.jwt.plugin [115]: Unable to resolve 115.0: missing requirement [115.0] osgi.wiring.package; (&(osgi.wiring.package=com.atlassian.sal.api.auth)(version>=4.0.0))

           It was loaded from C:\workspace\jira-event-listener\target\jira\home\plugins\installed-plugins\jwt-plugin-3.1.0.jar

Looks to me like jwt-plugin bundle cannot access com.atlassian.sal.api.auth. Should OSGI not handle all this for me automatically? What am I missing?

FYI, I’ve included my jira-maven-plugin definition below.

            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>jira-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <log4jProperties>src/aps/log4j.properties</log4jProperties>
                    <applications>
                        <application>
                            <applicationKey>jira-software</applicationKey>
                            <version>${jira.version}</version>
                        </application>
                    </applications>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <!-- Uncomment to install TestKit backdoor in JIRA. -->

                    <enableQuickReload>true</enableQuickReload>
                    <enableFastdev>false</enableFastdev>

                    <!-- See here for an explanation of default instructions: -->
                    <!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>

                        <!-- Add package to export here -->
                        <Export-Package>
                            com.example.tutorial.plugins.api,
                        </Export-Package>

                        <!-- Add package import here -->
                        <Import-Package>
                            org.springframework.osgi.*;resolution:="optional",
                            org.eclipse.gemini.blueprint.*;resolution:="optional",
                            com.atlassian.jwt.*;resolution:="optional",
                            *
                        </Import-Package>

                        <!-- Ensure plugin is spring powered -->
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                </configuration>
            </plugin>

Thanks!

1 Like

Having a very similar error message when installing an app with jwt-plugin 3.1.0 in Jira 7.6.0. It goes away in Jira 8 onwards.

Not sure if it’s just the matter of sal 4.0.0 being incompatible with Jira 7, as I even tried bundling it myself, but the problem does not go away. the SAL docs are outdated, so it’s hard to tell, really. I have to still support Jira 7, so this remains a problem.
https://developer.atlassian.com/server/framework/atlassian-sdk/sal-version-matrix/

@tom.gregory did you find the answer?