Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcpkix-jdk18on-1.77 MANIFEST.MF Import-Package versions not matching #1582

Open
NackiAir opened this issue Feb 8, 2024 · 2 comments
Open

Comments

@NackiAir
Copy link

NackiAir commented Feb 8, 2024

In the META-INF/MANIFEST.MF of bcpkix-jdk18on (v 1.77) the Import-Package field contains packages of bcprov-jdk18on but with required version 1.72. Therefore it cannot be started as bundle in OSGi with the (related) bcprov-jdk18on-1.77 library due to "Unresolved requirement" which is exporting these packages in the 1.77 version:

FrameworkEvent ERROR (OSGi) org.osgi.framework.BundleException: Could not resolve module: bcpkix [17] Unresolved requirement: Import-Package: org.bouncycastle.asn1.bsi; version="1.72.0" at org.eclipse.osgi.container.Module.start(Module.java:444) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

Extract of bcpkix-jdk18on-1.77/META-INF/MANIFEST.MF:
Import-Package: org.bouncycastle.asn1;version="1.72",org.bouncycastle. asn1.bc;version="1.72",org.bouncycastle.asn1.bsi;version="1.72",org.b ouncycastle.asn1.cmp;version="1.72",org.bouncycastle.asn1.cms;version ="1.72",org.bouncycastle.asn1.cms.ecc;version="1.72",org.bouncycastle

Extract of bcprov-jdk18on-1.77/META-INF/MANIFEST.MF:
Export-Package: org.bouncycastle;version="1.77",org.bouncycastle.asn1; version="1.77";uses:="org.bouncycastle.util",org.bouncycastle.asn1.an ssi;version="1.77";uses:="org.bouncycastle.asn1,org.bouncycastle.asn1 .x9",org.bouncycastle.asn1.bc;version="1.77";uses:="org.bouncycastle.

Please align the export and import versions of these librarys.
Or maybe think of removing the Import-Package version qualifier in future, knowing that may cause some runtime issues having multiple versions in OSGi environment (which is not suggested anyway...)

Thanks :)

@dghgit
Copy link
Contributor

dghgit commented Feb 10, 2024

So the OSGI imports in 177 are a bit of a mess, we weren't able to get multi-release working properly either. I think that's now fixed though, would you try what's in https://www.bouncycastle.org/betas ? Would appreciate some feedback from someone using OSGI "for real".

@NackiAir
Copy link
Author

Thank you for your fast fix. I took a look into the JARs MANIFESTs which now are looking good regarding the Import Versions!
Sadly the new MANIFEST now also contains imports of JVM java.* packages like java.io which is only allowed within the latest OSGi Specification 7. This needs an up-to-date OSGi framework running, which we are not using at the moment in our legacy system. I currently try to bring our framwork up to date and keep you informed when I tested successfully. This may take a while.

BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants