OSGI service loader resolution should be optional
See original GitHub issuePerhaps I am missing something, and someone with more experience interweaving java service loader and OSGI can explain why this resolution is not optional:
https://github.com/ical4j/ical4j/blob/9b82efeb7dc5ff0d2df238114225d157009ce96d/bnd.bnd#L3
It seems to me that this bundle is the bundle that is going to provide services under the package net.fortuna.ical4j.model.*
What I am experiencing is that the services are not registered until the bundle starts, and the bundle can’t start until something satisfies the requirement.
My testing shows that the bundle starts fine in an OSGI environment if “;resolution:=optional” is added to the end. E.g.:
Require-Capability: osgi.extender;filter:="(osgi.extender=osgi.serviceloader.processor)", osgi.serviceloader;filter:="(osgi.serviceloader=net.fortuna.ical4j.model.*)";cardinality:=multiple;resolution=optional
Additionally, the bundle starts fine if I use another bundle to register something useless under that package name; thus satisfying the requirement.
I believe making the resolution optional makes sense because this bundle doesn’t actually require another bundle to make the services available; however as per the spec, services provided by a different bundle under that namespace would still be visible to this bundle.
This is a fairly trivial non-breaking change, but would allow us to continue using this project, and it would be greatly appreciated if someone could consider this.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Ok I’ve submitted a PR to fix the typo
Considering this issue is still open and relevant, hence posting here.
In most recent release version (3.0.20) MANIFEST.MF file has
resolution=optional
where it should beresolution:=optional
(notice missing:
(colon) afterresolution
).Repackaging jar with updated MANIFEST.MF will remove errors from logs when loading.