Wednesday, August 20, 2008

Debug OSGi wiring issues with Structure101

If you have worked with OSGi, you would know that debugging problems related to bundle wiring can be a tedious task. The next generations of the Java family of products from WSO2 focuses on improved modularity. OSGi was the inevitable choice for us. The next WSO2 Data Services release is completely based on OSGi. During the development, we came across OSGi wiring related issues from time to time, and Structure101 seems to be a useful tool for debugging such issues. Structure101's rich visual environment exposes your software structure which helps you to understand structure, control complexity and define architecture. The latest version of Structure101 allows users to view OSGi bundle wiring.

Here's what you need to do.

1. Download Structure101g & the example flavors from

2. Extract structure101_gen_134.tar.gz (or zip) & & copy the "flavors" directory into the "structure101/s101g" directory.

3. Request for an evaluation license. This will be emailed to you.

4. Copy the license file into the "structure101-3/s101g" directory

5. Start structure101 by running the "structure101g" script

6. Select "Load on Demand" and select com.headway.examples.osgi from the drop-down list.

7. Provide the bundles directory. This is the directory in which your OSGi bundles are located. In the case of the WSO2 Data Services project on my machine, the location is /home/azeez/projects/wso2/trunk/solutions/data-services/java/modules/distribution/target/wso2-dataservices-1.0-beta10/webapps/ROOT/WEB-INF/plugins. Make sure that you click on the "Include Eclipse extensions" cell even if you do not intend to change the corresponding parameter value. Otherwise, the value you entered for the "Bundles directory" will not be taken. This is due to an inherent problem in JTables in Java Swing MVC. Click on "Finish"

8. You will now be able to view the OSGi bundle wiring. The diagram below shows the OSGi bundle wiring for WSO2 Data Services components. You can navigate to various bundles & wirings and view their respective properties.

To learn more about Structure101, see this demo
Post a Comment