Jump to: navigation, search

Jetty Web Container

Jetty and generic Web Container (RFC66) support

Work has started and is progressing well, there is a new GIT repo that produces a full Virgo build but based on Jetty instead of Gemini Web on top of the Virgo Kernel. The Splash screen application is working. The next step is to add JSTL bug 306971 and Security support for the Admin application. The Virgo-Jetty repo can be found listed on the source tab.

Bootstrapping Jetty

Jetty already supports bootstrapping inside OSGi and deployment of OSGi web applications. Jetty is a fully compliant RFC66 implementation and should be considered equal to Gemini Web in the functionality it provides. The Jetty bootstrapping bundle 'org.eclipse.jetty.osgi.boot' can easily be included in the list of initial artifacts automatically deployed into the user region during Virgo startup. This is the same way Gemini Web is bootstrapped in the Virgo Web Server.

Deploying Web Applications

It is possible to deploy web applications programatically to both Gemini Web and Jetty via services they publish but it can be done in a generic fashion using the Web container's Extender to pick up WABs once deployed by Virgo and the URLStreamHandler to transform legacy war files in to WABs. The resulting process would look like this.


Does RFC66 guarantee that the URLStreamHandler only modifies the manifest? Yes

This can be achieved in a generic fashion so that it has no dependencies on the implementation of the Web Container.

The Web Layer

The existing web layer provides integration between the Web Container and Spring dm that would need to be maintained as well as the War support. With the above aim the web layer could be redesigned as the shown in the following diagram.


This gives the ability to remove support for War files and Spring dm if it is not required. That support being provided in an agnostic and optional way. The Tomcat bundle will always be required when running with Gemini Web due to issues with OSGi and Tomcat. The only remaining dependency on Gemini Web would be the Tomcat SPI from the web.tomcat bundle as all other interaction would be though core OSGi types and the service registry.

Class Loading

Need to ensure correct class loading and resource lookup in the single bundle case as well as the case of a web bundle inside a scoped plan. Need to support throw-away class loaders, etc. as in the current Virgo web support. Further investigation is required in to class loader customisation and to see how this is handled and to ensure it is tested in some way.


Any RFC66 implementation will provide Event notification to EventAdmin, this is already picked up and reported to Virgo logging system (Medic). The Web layer has a tomcat specific bundle that uses a registry of currently installed web applications to set the name of each application to the Threads currently being used by it. This is tied to Tomcat so will require some work to implement for either Jetty or in a generic way.

Summary of work required

  • Move to a newer version of Jetty that includes JSTL support bug 306971
  • Re-factoring of the web layer to the new design (partially completed during the investigation, Web repo, 'jetty-support' branch)
  • Configure security support in the embedded Jetty
  • Implement Thread naming for Applications deployed in Jetty in the same way as Gemini Web
  • Classloading hook investigation