Solution was to use a OSGified version of log4j as provided dependency. I had it as a compiled dependency. Log4j manifest mentions this package as an optional depndency, so maven-bundle-plugin added it to my bundle's manifest, but did not make it optional.
Cannot start OSGi bundle, missing com.ibm.uvm.tools
-
02-12-2021 - |
Question
I am trying to start a bundle, with a whole bunch of dependencies. I am getting the error could not be resolved. Reason: Missing Constraint: Import-Package: com.ibm.uvm.tools
, but cannot find this package in the maven repos or on the web. By marking this package (and a bunch of others) optional in the Import-Package directive, I can resolve the package, but it fails to start if the dependencies are not met. What can I do to resolve this Import-package?
I am using the maven-bundle-plugin to generate the bundle.
Solution
OTHER TIPS
You have built your bundle with a couple of jars on the classpath. Otherwise your bundle would not reference anything in a package named com.ibm.uvm.tools
. Now you need to see whether or not this jar is OSGi-ready (specifying the correct headers and package-exports). Maybe there also exists a 'OSGi-fied' version of that jar, have look at the springsource repository for example.
Looking at the package name, I assume the probably proprietary code that cannot be found re-wrapped in any public repository, then you may try to wrap it as a bundle yourself , having a look at this stackoverflow question.