Web Frameworks on OSGi Matrix
The RFC66 – OSGi Web Container is currently under discussion, but it is already possible to deploy web applications in any OSGi container using the great Pax Web and Pax Web War Extender (the two projects will be merged soon).
But does this mean that it is also possible to use any Java Web Framework with OSGi?
Unfortunately that’s not the case. On the contrary, many of the most famous web frameworks internally use some “hacks” or classloading trick preventing them to work out of the box in a OSGi container.
The following table (under-construction!) tries to summarize the situation:
| Framework | Situation | References |
| Apache Wicket | Pax Wicket is an OSGi-based extension to the Wicket framework. Whereas a typical Wicket application requires that all component wiring be done at compile time, this extension allows you to model the Wicket application, and move those model parts around and not be resolved until request time. You can add and remove parts of the Wicket application without restarting the application, simply by loading and unloading OSGi bundles. New sections can be added, and if properly prepared, menu items for those sections can be added to all existing pages. |
Pax Wicket |
| Apache Struts | A full OSGi scenario seems not to be supported yet, but there is an OSGi Plugin providing support for starting an instance of Apache Felix inside a web application, and scanning installed bundles for Struts configuration. An admin bundle is also provided. | Struts OSGi Plugin |
| Stripes | No successful use cases reported. Issues with dynamic discovery of ActionBeans | Email thread on stripes-users |
| Spring MVC | Reported to work on OSGi | |
| Google Web Toolkit | Reported to work | gwt-in-osgi |
| Apache Tapestry | Success reported, even if it’s not clear if it’s a full OSGi scenario. | Tapestry-OSGi |
| Apache Sling | It is an open source Web framework for the Java platform designed to create content-centric applications on top of a JSR-170-compliant (aka JCR) content repository; it is specifically designed to run on a OSGi container. |
As you can see, that’s only a first draft of the Web Framework on OSGi matrix. Have you had any success using a popular Web Framework in a OSGi container? Please add a comment to this post sharing you experience!
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Check out Apache Sling – it was built on OSGi right from the start
@Michael of course I know Sling, I didn’t considered in this survey since it’s quite a peculiar and new framework.
There’s the Rich Ajax Platform (RAP) which has been around for quite awhile.
http://www.eclipse.org/rap
It allows for RCP applications to run via the web and desktop via the Qooxdoo JavaScript framework (http://qooxdoo.org/).
If you find any problems using Spring MVC on OSGi let us know and we’ll have a look. (http://jira.springframework.org/browse/SPR)
We have no reason to think it isn’t. We have have also done the RI of RFC66 which is now part of the dm Server. Read more here; (http://blog.springsource.com/2009/05/27/introduction-to-the-osgi-web-container/)
Caveat, I do work for SpringSource but I just wanted confirm our support in this area.