The OSGi Look

There’s life beyond JavaEE

Posts Tagged ‘pax

Starting with OSGi? Try Pax Runner!

with one comment

Despite what you can read in forums or mailing lists, starting with OSGi is just a matter of minutes if you use the right tool. And the name of the right tool is Pax Runner.

Pax Runner Logo

Pax Runner claims to be

a tool to provision OSGi bundles in all major open source OSGi framework implementations (Felix, Equinox, Knopflerfish, Concierge).

but is actually much more. With Pax Runner Read the rest of this entry »

Written by fdiotalevi

July 28, 2009 at 8:19 pm

Posted in osgi, pax, tutorial

Tagged with , , , ,

Web Frameworks on OSGi Matrix

with 4 comments

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!

Written by fdiotalevi

June 19, 2009 at 10:24 am

Posted in osgi

Tagged with , , , , , , , ,

Embedding Jetty in OSGi: The Definitive Guide

leave a comment »

…. well, not really definitive, since there’re a number of techniques/tools you can use to embed a servlet container in OSGi.

I found the approach I’m going to show here particularly simple and compatible with all the containers.

What you need

You really need just a few bundles:

Java Servlet API (2.4.0) [1]
OPS4J Pax Web – Service (0.5.1) [2]
OPS4J Pax Web Extender – Whiteboard (0.4.0) [3]

The Pax Web bundle [4] contains an embedded Jetty [6] servlet container, that is automatically started as soon as the bundle is deployed. The Pax Web Extender – Whiteboard bundle [5] provides a useful extension allowing developers to define new servlets on the fly.

Read the rest of this entry »

Written by fdiotalevi

February 9, 2009 at 6:15 am

Posted in jetty, osgi, tutorial

Tagged with , , , , ,