Wednesday, 27 July 2016

Use Cases for skysail-webconsole Part 1

As written in some older posts (see here and here) skysail webconsole aims to visualise an OSGi runtime and provides you with all relevant information of the installed bundles, their services, packages and relations between them.

The information itself is derived from standard OSGi interface and _could_ be obtained using
the OSGi console using standard commands of the framework implementation (like 'ss' for show status in equinox or lb for 'list bundles' in apache felix). But skysail webconsole tries to make things more convenient both for OSGi beginners and experts.

This series will give you some ideas of how to use skysail webconsole, specifically if things don't seem to be working the way you expect them. Please be aware that the webconsole project is still work-in-progress and subject to change. If you have any feedback, ideas or questions, please let me know.

"could not resolve bundles"


The dreaded OSGi message for beginners (and experts?). What you get as a message on the console might look like this:

! could not resolve the bundles: [io.skysail.bundled.htmlunit-osgi-withdeps-2.22.1.201607270705Unable to resolve io.skysail.bundled.htmlunit-osgi-withdeps [15](R 15.0): missing requirement [io.skysail.bundled.htmlunit-osgi-withdeps [15](R 15.0)] osgi.wiring.package; (osgi.wiring.package=javax.servlet) Unresolved requirements: [[io.skysail.bundled.htmlunit-osgi-withdeps [15](R 15.0)] osgi.wiring.package; (osgi.wiring.package=javax.servlet)]]

It is not like is doesn't say what's happened; the bundle 'htmlunit-osgi-withdeps' is not able to access the package 'javax.servlet' (as this package is not exported by any bundle), therefore the bundle cannot be resolved.

Now, assuming you fix this dependency, it is very likely that you will get a similar message when your start the framework again, this time referencing a different package which is also missing.

skysail webconsole 


With skysail webconsole, you can look inside the running framework and figure out all dependencies which are not fulfilled. Of course, the webconsole will not magically make your bundle resolve, but in the "imported packages view" you'll find all packages which cannot be resolved. This could be a real time saver and might save you from some frustration (namely, constantly and somehow randomly adding new bundles to make your initial bundle resolve, one at a time and over and over again.)

This is a version 0.1.10 screenshot of the "imported packages view":