3

Working on a project that runs an embedded Jetty web server withing its infrastructure. We are looking at addings a new web application that would benefit greatly from allowing views to be plugged in using OSGi. Vaadin is our web framework of choice.

There is a great tutorial on creating an OSGi pluggable Vaadin application in GlassFish where the web container and OSGi container are bridged. That is, the web container is not running in the OSGi container. Here is the tutorial: https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20Modular%20Vaadin%20Application%20with%20OSGi

My question is. Would it be possible to bridge an embedded Jetty web container and OSGi container in the same way as described in this tutorial.

Running jetty in an OSGi container is simply not an option for us as we have to work with existing deployment.

S73417H
  • 2,661
  • 3
  • 23
  • 37

2 Answers2

1

You should be able to embed any 4.2 compliant framework via the org.osgi.framework.launch.FrameworkFactory class. There's a few good examples if you google, two good ones are on the Felix site, and Neil Barlett's blog.

Configuring it will be far more work - you'll need to export all the Jetty and servlet packages via a system property org.osgi.framework.system.packages.extra and use something like Felix fileinstall or a console and pax-url to un/deploy bundles.

While your Vaadin app will be dynamic - nothing from Jetty or the embedding application will be (i.e. domain entities, services etc).

earcam
  • 6,662
  • 4
  • 37
  • 57
0

Could you embed a different container? Eclipse Virgo and JBoss AS are both OSGi and J2EE containers.

cvanes
  • 31
  • 3