FasterXML / FasterXML/jackson-jaxrs-providers
Add optional bundle dependency
- Dominant language
- Java
- Stars
- 126
- Forks
- 83
- Avg merge
- 10h 11m
- Merged PRs (30d)
- 1
Description
Hello,
I am using bundle `com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider` in an OSGi environment. The first thing I got was this exception:
> java.lang.ClassNotFoundException: com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector cannot be found by com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider_2.6.3
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
> at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> at com.fasterxml.jackson.jaxrs.json.JsonMapperConfigurator._resolveIntrospector(JsonMapperConfigurator.java:109)
The bundle `com.fasterxml.jackson.module.jackson-module-jaxb-annotations` was active, but not visible by the class loader of the first bundle.
My workaround was a fragment bundle. However, my suggestion here is to make the first bundle depend _optionally_ on the other:
```
Require-Bundle: com.fasterxml.jackson.module.jackson-module-jaxb-annotations;bundle-version="2.6.3";resolution:=optional
```
Thanks for the good work,
Björn
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.