Robert Dunne

OSGi Dependencies: Heaven and Hell

The road to hell is paved with unsatisfied dependencies

OSGi bundles don’t share code arbitrarily like ordinary jars. Instead they explicitly export the packages they want to share and import the packages they need. Before you can use code from a bundle, it has to be resolved by the OSGi framework. Resolution involves matching each package a bundle imports with a package exported by some provider bundle. The provider bundle also has to be resolved, so the whole process is recursive.

Manually working out which bundles you need to install before the bundle you are actually interested in will resolve can be a long winded process in which you install the bundle you want, try to resolve it, fail, add more bundles in response to the error messages, fail, tear out some hair, add more bundles, and repeat, until finally you get something that works. At this point you can look at the resolved set of bundles and make a note of them and the order you installed them in to make it work. Even then the result is quite brittle because each resolution is sensitive to the state of the framework and to bundle versions. To cut a long story short, doing things this way leads straight to the OSGi dungeon in dependency hell.  (more…)

Nimble at OSGi DevCon

I'm speaking at EclipseCon 2010I’ll be discussing Nimble at the OSGi DevCon part of this year’s EclipseCon in a talk called Next generation OSGi shells.

If the promise of OSGi’s modular approach appeals to you, but you’ve found that day to day use of OSGi feels heavyweight and awkward, then you have my sympathy and understanding. Until recently working with an OSGi framework has felt the way that working with Unix would without a shell like Bash. It doesn’t have to be that way: a new generation of OSGi shells that enables a more agile and productive OSGi experience is now emerging.

Please come along to the talk where, using Nimble as an example, I’ll show you how much better a powerful, scriptable, shell with an integrated dependency resolver can make working with OSGi.

Nimble’s OSGi Config Admin Client

If you’ve adopted OSGi and are using it to factor your applications into modular dynamic systems, then you are probably interested in configuring them in a similarly modular and dynamic way. The OSGi Configuration Admin service is a widely used standard for doing just this.

This post introduces Nimble’s command line interface to the Config Admin service and shows how it can be used to configure an OSGi HTTP Service implementation.

To get started you’ll need to download Nimble (it’s only 55k). On Linux/OS X you can start it using:

$ bin/posh

For windows use:

% bin\posh.bat

This introduction was tested against Nimble 1.0.8. To make sure you’re up to date just type:

% version

at the Nimble prompt, and follow the instructions to get Nimble to self-update if necessary.

The Config Admin service (more…)

Nimble Post Round-Up

David Savage has written some great introductory Nimble posts. In case you missed them here’s a quick round-up: