On Sun, Nov 22, 2009 at 2:06 PM, Andreas Studer <studer@...> wrote:
> Hello Marcello
> Congratulations for your commitment to OSGi. Long time ago when there
> was a discussion about a new plugin system for vqwiki, I guessed to have
> a look for OSGi (instead of Spring, in the case of the container for the
> plugin system). The major killer feature was the dynamic starting /
> stopping of components / plugins.
> However, this is a different philosophy than J2EE has (in J2EE, you
> should do it with the admin console, JMX and so on; in other words, the
> built-in component container should handle this over the built-in admin
> console. Not so easy to handle, because in my opinion there are too much
> different implementations / solutions for this case). But there are
> different impmementation to separate a component administration from the
> J2EE included component administration system (e.g. Axis2 has its own
> admin console for the Webservice-Components).
> Equinox starts the container Jetty as component instead of vice versa,
> which is rather cool, but seems to me not an easy handling for a user /
> operator for e.g. the vqwiki-philosophy. Just for my interest: How does
> Felix integrate OSGi in a J2EE environment?
you are correct in writing that the usual (and most correct imho)
way of developing web applications in OSGi is to embed the servlet
container in the OSGi container; that's the way I always develop my
However, as you noticed, this approach makes your application
difficult, if not impossible, to be installed in a generic JEE server;
in fact, if your jee server is not osgi based, it's unlikely to be
embedded in an OSGi container; on the other side, if your application
server is OSGi based (like most of the modern ones) you're still not
sure which version of OSGi they use (websphere uses r4.0 for
The solution is to work the way around, that is, embed an OSGi
container in a Java Web Application; this approach is more error prone
(classloading is more complicated, in essence), but it is documented
in several places like , , 
In particular, the idea is to use the Atlassian Plugin Framework that
does exactly that, and is BSD-licensed.
As for the OSGi container choice, Felix has always been known for
being more easily embeddable (even if it may change since the startup
api has been standardised in R4.2); in any case, being the core
framework 300KB, it's without any doubt more lightweight that Equinox.
Hope this clarify,