Home Posts Running Web Admin Console for OSGi Applications
Running Web Admin Console for OSGi Applications Print E-mail
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.zip

All 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:

  • The HTTP Service: It needs the HTTP Service so it could register Web Console's servlet. The HTTP service is provided by the bundle archive "pax-web-service-0.5.0.jar" of the Pax Web project, this bundle runs Jetty Servlet Container and registers an HTTP Service in the OSGi Environment.
  • Some Service APIs from the OSGi Service Compendium: These include HTTP Service, Log Service, Configuration Admin Service, Metatype Service and Preferences Service. These are provided by the bundle archives "org.eclipse.osgi.services_3.1.200.v20071203.jar" and "prefs_api-2.0.0.jar".

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:

  • Download the example above.
  • Take all the bundle archives from the "/webconsole-example/bundles/system-bundles" directory and install all of them except "org.apache.felix.webconsole-1.0.0.jar" to the OSGi Environment.
  • Start the installed bundles.
  • Install and start "org.apache.felix.webconsole-1.0.0.jar".

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".

 

Project Updates

  • Dynamic-RS 1.0.0 - 12/15
  • Dynamic-JMS 1.0.0 - 10/23
  • Dynamic-WS 1.1.0 - 09/10
  • DA-Launcher 1.1.3 - 09/10
  • Bundler - 1.0.2 - 09/10

Latest Articles

  • Logging OSGi Applications - The Simlpe and Robust way. Read. 06/24
  • Testing OSGi-based Applications with DA-Testing. Read. 04/01
  • Esper-OSGi Integration. Read. 03/11
  • Tackling OSGi Package Wiring Conflicts. Read. 01/13
  • Consuming objects created in the OSGi Environment from a non-osgi application. Read. 12/02