I am getting the following error when I try to start one bundle
Chain 1:
foo.bar.fizz.core.rest.impl [foo.bar.fizz.core.rest.impl [208](R 208.0)]
import: (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(version>=2.0.0)))
|
export: osgi.wiring.package: javax.annotation
org.apache.felix.framework [org.apache.felix.framework [0](R 0)]
Chain 2:
foo.bar.fizz.core.rest.impl [foo.bar.fizz.core.rest.impl [208](R 208.0)]
import: (&(osgi.wiring.package=foo.bar.fizz.cdac.tableobject.api)(version>=8.60.0)(!(version>=9.0.0)))
|
export: osgi.wiring.package=foo.bar.fizz.cdac.tableobject.api; uses:=com.google.common.collect
foo.bar.fizz.cdac.tableobject [foo.bar.fizz.cdac.tableobject [196](R 196.0)]
import: (&(osgi.wiring.package=com.google.common.collect)(version>=16.0.0)(!(version>=17.0.0)))
|
export: osgi.wiring.package=com.google.common.collect; uses:=javax.annotation
com.google.guava [com.google.guava [29](R 29.0)]
import: (osgi.wiring.package=javax.annotation)
|
export: osgi.wiring.package: javax.annotation
org.jsr-305 [org.jsr-305 [28](R 28.0)] Unresolved requirements: [[foo.bar.fizz.core.rest.impl [208](R 208.0)] osgi.wiring.package; (&(osgi.wiring.package=foo.bar.fizz.cdac.tableobject.api)(version>=8.60.0)(!(version>=9.0.0)))]
I understand why the error comes (because one dependency is coming from two flows and osgi is confused between the two). However, I don't get how to avoid this since one flow is "org.apache.felix' which starts with 0 start level and I can't seem to alter that.
Here are more logs for the bundle:tree-show
foo.bar.fizz.cdac.tableobject [197]
+- foo.bar.fizz.cdac.api [194]
| +- foo.cil.cdac.cil-cdac-common-api [133]
| +- avro [292]
| | +- org.xerial.snappy.snappy-java [329]
| | +- jackson-core-asl [314]
| | +- jackson-mapper-asl [315]
| | | +- jackson-core-asl [314]
| | +- org.ops4j.pax.logging.pax-logging-api [6]
| | | +- org.apache.karaf.services.eventadmin [3]
| | | +- org.apache.felix.metatype [2]
| | | +- org.apache.felix.configadmin [9]
| | | +- org.apache.felix.coordinator [8]
| | +- org.apache.commons.compress [293]
| | | +- org.tukaani.xz [328]
| | +- com.thoughtworks.paranamer [257]
| | +- org.glassfish.hk2.external.jakarta.inject [92]
| +- com.google.gson [252]
| +- foo.bar.common.datatypes.date [224]
| | +- joda-time [287]
| +- foo.cil.client.service [136]
| | +- avro [292]
| | +- org.apache.servicemix.bundles.lucene [309]
| | +- org.apache.servicemix.bundles.lucene-queryparser [307]
| | +- org.apache.servicemix.bundles.lucene [309]
| | +- org.apache.servicemix.bundles.lucene-sandbox [308]
| | | +- org.apache.servicemix.bundles.lucene [309]
| | | +- org.apache.servicemix.bundles.jakarta-regexp [303]
| | +- org.apache.servicemix.bundles.lucene-queries [306]
| | +- org.apache.servicemix.bundles.lucene [309]
| +- org.ops4j.pax.logging.pax-logging-api [6]
| +- foo.bar.fizz.businessentity [193]
| +- foo.bar.common.datatypes.date [224]
+- foo.bar.common.datatypes.date [224]
+- com.fasterxml.jackson.core.jackson-databind [242]
| +- com.fasterxml.jackson.core.jackson-annotations [238]
| +- com.fasterxml.jackson.core.jackson-core [240]
+- org.ops4j.pax.logging.pax-logging-api [6]
+- foo.bar.fizz.businessentity [193]
+- com.google.guava [30] <- START LEVEL
+- org.jsr-305 [29]
+- org.glassfish.hk2.external.jakarta.inject [92]
karaf@root()>
What have I tried and did not work ?
- I tried blacklisting the bundle but nothing really happened.
- I tried excluding the dependency that is causing this problem (jsr-305) but that did not work either.
- Start level changed.
Please suggest something that can solve this or at least point me in the right direction.
The solution I opted for is to change my osgi implementation from Felix to Equinox.
Apparently, karaf, by default, uses felix but you can override it using custom.properties file and add the following line to it
Dir structure
File content
Explanation
Felix provides its own javax.annotation which I couldn't exclude so I opted for this solution.