-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
Jackson bundles are missing OSGi's osgi.serviceloader metadata #768
Comments
Being bit of OSGi newbie, quick question: is this really needed for So what would be the meaning of |
The story becomes more complicated with |
Thank you @chrisr3! Interesting that this hadn't been reported before but I guess better late than never :) |
No worries. The
I'll also mention that I haven't found any direct invocations of |
Yeah I wouldn't count on Woodstox having it correct. Would obv. love help there too if someone could point out better ways. As to Jackson, there is no |
There are "ways" around bundles having broken metadata. However, it's much easier if the bundles are fixed at source 😉. |
note to self: Woodstox PR FasterXML/woodstox#151 should work as template here. |
|
Yes. I'll go ahead and do that now, then: FasterXML/jackson-dataformat-xml#536 EDIT: Done. |
This change will require the Aries SPIFly bundle and the jackson-core bundle will not resolve wherever Aries SPIFly bundle is missing. Not everyone has the Aries SPIFly available at runtime, so, this is a problematic upgrade from v2.13.x to v2.14.0 As v2.14.0 is a minor update and should be backward compatible but it is not as per current requirements of Aries SPIFly bundle. Also, people hardly use ServiceLoader mechanism in OSGi because of class loader issues. @chrisr3 wht problems were you facing due to ServiceLoader etc.? @cowtowncoder I think this change should be reverted from 2.14.x releases at least, 3.x you can decide later. |
The solution to that is to make the requirement optional, as has already been done with Woodstox. I'm sorry, I thought we already knew this? |
If there is more work to do, a new issue, PR is needed. I am not currently working on any changes; and if some are needed for 2.14.0 it's important to get these done ASAP as the last planned release candidate (2.14.0-rc2) is out. |
See #822. |
Excellent, thank you @chrisr3. This fell through the cracks on my side; I should have remembered the necessary fix. @rakeshk15 WDYT? If this does not resolve the fundamental problem, yes, I can revert this from 2.14. However, not sure it should wait until 3.0 since future wrt major release is still but uncertain. |
I think what @chrisr3 did make sense, making the osgi.serviceloader.registrar requirement as optional. This way the jackson-core bundle will always be resolved, if there is a osgi.serviceloader.registrar capability(Aries SPI Fly) available in OSGi runtime then the ServiceLoader mechanism will work otherwise it will be silently ignored. |
Ok good, thank you for confirming @rakeshk15. |
Unfortunately, had to revert due to #824. Not sure what would be the part forward here, but will not be happening for Jackson 2.14 as of now. |
I must say I'm surprised that Spring sees this warning because the |
Hi @chrisr3 the problem is due to the usage of Resolution enum in ServiceProvider annotation. I think @cowtowncoder is right here to postpone it for post v2.14 releases, we don't know if someone else will face some other kind of issues if this fix is shipped with v2.14. Other non intrusive fix(without the usage of any annotation lib etc.) would be to add the serviceloader.registrar OSGi Manifest headers manually inside pom (maven-bundle-plugin or bnd-maven-plugin(in pom or bnd file) configuration section). But again, safer would be plan this for 2.14.x or even 2.15. I leave this decision to @cowtowncoder |
Thank you @rakeshk15. As to OSGi manifest: we are using Felix plug-in for OSGi bundle creation and I assume addition should be doable, but I would need someone else to provide that. If this could be done quickly I'd be ok in including such change still in 2.14.0 -- esp. if it gets in before 2.14.0-rc3 (at this point I think it is unfortunately necessary to do one more RC). I plan on closing issues today and if I have time do 2.14.0-rc3 release tomorrow. |
This should work too and is probably the best short-term alternative. |
PRs welcome for improvements; I don't quite know what to add. But it would be great to improve the situation for upcoming Jackson 2.15 as well as Woodstox. |
Bundles need to include extra metadata to support
java.util.ServiceLoader
inside an OSGi framework. Jackson's bundles are all missing this metadata.In theory, it should just be a matter of applying Bnd's
@ServiceConsumer
and@ServiceProvider
annotations in the correct places as described here, where these annotations can be provided like this:I am struggling to wrap my head around your myriad of separate repositories, and so you may have a better way of providing this dependency.
The text was updated successfully, but these errors were encountered: