osgiapache-karafspring-dm

Interrogate OSGi/Spring-DM Framework For A Bundle's Dependencies


I'm using Spring-DM in a Karaf (4.0.1) instance and am trying to start several Spring-DM enabled bundles (which I am not the author of).

These bundles have several dependencies/service dependencies which would be injected by Spring-DM and I am currently working through fulfilling all of the dependencies however the task is laborious and time consuming.

There are several options I currently used to determine the dependencies:

  1. Inspect the `META/Spring' folder of the bundle and examine the XML files within.
  2. Install a bundle and examine the Karaf log for bundle failure messages.

This methodology to me isn't very efficient and I wondered if there was a way I could interrogate either the OSGi framework (Karaf in this case) or Spring-DM itself and query what a particular bundle is waiting for to be fulfilled.

I could write a Karaf commandline command to allow me to do this but I don't know how to go about interrogating Spring-DM or Karaf to get the information.

Any suggestions?


Solution

  • You should not have to look into spring DM. The first step is to make sure all package imports are working. The easiest way is to look into the Manifest of the bundle to install or use bundle:headers. As soon as the bundle installs you can use the diag command to check which services it waits for.