BundleException - missing requirement

Hello everyone,

When trying to install my own addon in Jira via UPM, activation fails and the following message appears in the log:

Caused by: org.osgi.framework.BundleException: Unable to resolve com.mycompany.jira.addon.myaddon [297](R 297.0): missing requirement [com.mycompany.jira.addon.myaddon [297](R 297.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=9.0)) Unresolved requirements: [[ch.zuara.jira.addon.customerknowsremaining [297](R 297.0)] osgi.ee; (&(osgi.ee=JavaSE)(version=9.0))]
at java.lang.Thread.run(Thread.java:748)

What I already tried:

Do you have any other hints what could be the problem?

1 Like

You have a module-info.class in your classpath likely extracted from one of your dependencies. You can set extractDependencies to false which will prevent this problem. Additionally, you can upgrade to AMPS 8.0.4 which will solve the bug that you’re experiencing.
https://ecosystem.atlassian.net/browse/AMPS-1509

4 Likes

Hello @dennis.fischer

Thank you for your hint. I tried your tips. However it was not the problem.

My colleague fixed it and told me that the problem was either compiling with Java 9 or a misconfigured Google gson dependency which caused the problem.

Before:

com.google.code.gson gson 2.8.6

After:

com.google.code.gson gson 2.2.3 provided
1 Like

Hello @KevinSuter,

Nice that you were able to solve it.
Gson 2.8.6 added a module-info file (Java 9) and you had extractDependencies property not set to false. This is exactly the problem which is tracked in AMPS-1509.

Thank you for the answer!
It took me a working day to resolve this. Regret that did not start googling right away.

It worked for me, thanks @dennis.fischer !!

I encountered the same issue while deploying a plugin on a Jira Server 9.x instance. The error was caused by the following exception:

Caused by: org.osgi.framework.BundleException: Unable to resolve myjar [18](R 18.0): missing requirement [myjar [18](R 18.0)] osgi.extender; (&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0))) Unresolved requirements: [[myjar [18](R 18.0)] osgi.extender; (&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))]

Root Cause of the Issue:

The problem arose because I used the @Component annotation from org.osgi.service.component.annotations.Component instead of the Spring @Component annotation. This caused a mismatch in the OSGi component resolution, as the plugin was expecting Spring-based component management but encountered OSGi-based annotations instead.

Fix:

After replacing the @Component annotation from org.osgi.service.component.annotations with the Spring @Component annotation, the issue was resolved.