0

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?

D-Dᴙum
  • 7,689
  • 8
  • 58
  • 97

1 Answers1

0

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.

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64
  • If a bundle is in 'wating' state, diag just reports that it's waiting, but not what it's waiting for. I either have to scroll bag through the logs to see when the bundle was installed and look for an 'info' log (in blue text) or wait for the wait to 'timeout' and even then diag doesn't report the exact failure. For that I must inspect the log. What would be good is if I can simply ask, through API calls if there are any, what is bundle X waiting for. If such and API exists I can create a Karaf command. – D-Dᴙum Oct 04 '15 at 19:18
  • a "waiting" state, usually indicates it is waiting on a service. Similar to the GracePeriod by std. Blueprint services. So actually make sure all those requirements are also met. The current diag command already shows what a blueprint bundle is "waiting" for, so maybe this can also be applied to a spring-dm bundle. – Achim Nierbeck Oct 05 '15 at 12:53
  • There already is support for spring dm status events in the diag command. The bundle org.apache.karaf.bundle.springstate should supply this information. If you have this bundle installed but do not see a reason for the wait then this is a bug. Can you open an issue at karaf? I can look into it. – Christian Schneider Oct 06 '15 at 08:42
  • OK I created an issue. I didn't see your replies until today. – D-Dᴙum Oct 27 '15 at 10:55
  • I do not follow all karaf issues. So if you create one better post the link so I see it faster. – Christian Schneider Oct 27 '15 at 10:58