| Running Web Admin Console for OSGi Applications |
|
|
| Written by Valery Abu-Eid | |
| Sunday, 24 August 2008 22:13 | |
|
I was looking for a Web Admin Console for OSGi Environments that would allow me to know the state of my bundles and manage my OSGi-based application at a basic level (installing, starting and stopping bundles) and the Apache Felix Web Console seemed to fill the need. First and foremost it has no dependencies on Felix at all, so it can be used with any other OSGi Framework. Second, it has a simple and pretty AJAX based interface. Additional to the basic needs it appeared to be very useful when I had a problem with package wiring since it showed me all the packages imported by a bundle I had and the bundles it imported the packages from. Below is a screenshot of the Web Console: The main problem with Felix Web Console was like with any other project provided by OSGi vendors, you never know how to get started. The Felix web site provides a link to the source code and another for the bundle... and thats all - Actually, it's not even mentioned that the JAR file was a bundle, I just figured that by looking at the manifest file. Another problem was to know the dependencies and which URL I can access the management interface from - As for the URL, I had to look into the source code to figure that it was "/system/console". So basically, this post is about how to run a Web Management console for your OSGi-based application as simple and fast as possible. From the link below you can download an example application which runs the Apache Felix Web Console. Taking into account that the application is launched using DA-Launcher, all you need to run the application is executing the executable file available in the "/webconsole-example/bin" directory. After running the application you can access the admin interface from your browser on the following URL: http://localhost:8080/system/console/list. If you want to use port other than 8080 for the Web Console, update the value of the property "org.osgi.service.http.port" in the "/webconsole-example/config/osgi-framework.xml" file. webconsole-example.zipAll example application bundles exist in the "/webconsole-example/bundles/system-bundles" directory. The "org.apache.felix.webconsole-1.0.0.jar" is the Bundle Archive of the Web Console, the rest of the files are dependency bundles needed for the Web Console bundle. A little on Felix Web Console dependencies:
If you would like to run the Web Console in an OSGi-based Application that is not launched using DA-Launcher then all you need to do is to:
If you already have an HTTP Service running in your application then you don't need to install "pax-web-service-0.5.0.jar". |