What about setting "Eclipse-BundlePolicy: dependent" in OSGi Metadata of jackson-databind? #4142
-
So I'm stumbling over some hackery here, which is about repackaging jackson-databind.jar to add "Eclipse-BundlePolicy: dependent" to OSGi Metadata. Then, that repackaged jar is put into some P2 Update Site, used to define some specific (Eclipse/OSGi) Target Platform, for the application being some Rich Client Platform application. That metadata property is required to allow the OSGi bundle classloader of that jackson-databind bundle to find the application classes, and actually I wonder how anyone is able to use jackson-databind in some OSGi environment without that property. Somehow I don't have so much luck finding some relevant docs on that topic. After all, I still want to add jackson-databind.jar to Target Platform, but instead of the indirection via some dedicated P2 Update Site, I want to add it as Maven dependency right within Eclipse, which is possible since ~2021. WDYT? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Since I do not know a lot about OSGi (nor run on OSGi in production), I hope someone else can comment here. I am happy to merge PRs for improvements of course. |
Beta Was this translation helpful? Give feedback.
-
FWIW, 've found issue #624 and PR #854 about the same topic, but I haven't found a way to set up class loading via 'TypeFactory' during set up of 'ObjectMapper'. |
Beta Was this translation helpful? Give feedback.
-
Meanwhile, I've learned that using |
Beta Was this translation helpful? Give feedback.
Configuration would occur by accessing existing
TypeFactory
, calling itswithClassLoader()
method, resetting.So either with 2.x methods of
getTypeFactory()
andsetTypeFactory()
.Or if using
MapperBuilder
(JsonMapper.builder()
) similar methods.