Wednesday, March 17, 2010

More OSGi goodness

There is a new feature in the Beta refresh of the OSGi feature pack which went out last week - a tool to inspect application bundles. Here are some brief instructions on how to use it.

First, install the feature pack (see here) and start the application server, then at the shell command line navigate to:


There is a script in there called (or .bat), run it and you should get a "wsadmin>" prompt. Use the list() at the prompt and it will show you ... nothing. That's fine, you need to install and start an application before you can see anything.

Install and start the Blog Sample (as described here), then try list() again, you will see something this:

Two frameworks are listed, 'shared bundles' and the Blog application. Connect to the first like this:


Use the ss() command to look at what is in it:

You don't have to disconnect from a framework explicitly, so to look at framework 1 (the Blog application) just connect to it:

wsadmin> connect(1)

then ss() shows the blog sample bundles.

This may by now be looking slightly familiar to anyone used to the Equinox OSGi console. The difference is that WebSphere is partitioning the space into separate application frameworks which you can look at individually - nice feature if you have a lot of applications. By the way, if you forget which framework you are connected to, list() at the wsadmin> prompt will tell you.

Other console commands can be found in the documentation, or by using 'help()' at the wsadmin> prompt. Have fun!