Equinox in a Servlet Container

Overview

One of the original objectives for the server-side work was to look at what's involved in launching and interacting with various server-side containers. Currently, there is actively maintained work in support of embedding in a servlet container.

Bundles

There are four Eclipse projects involved:

These four project can be downloaded from the equinox CVS depot.
(e.g. cvsroot/eclipse/org.eclipse.equinox.servletbridge)

To develop web applications you'll also need the javax.servlet bundle from the Orbit CVS depot.
(e.g. cvsroot/tools/org.eclipse.orbit/javax.servlet [branch v2_3 or v2_4])]

[Suggested] If you're using Eclipse it might be far simpler to "import" a team project set with everything needed. (regular) or (proxied)

Additional Notes:

Quickstart

This set of instructions should get you up and running in a just a few minutes.

  1. Install a servlet container (e.g. Tomcat, Jetty, or whatever is handy)
  2. Download and deploy this pre-built web application archive. (bridge.war) [built 2007.04.02]
  3. Start the web container and verify things are installed correctly by going to "/sp_test". (e.g. http://localhost:8080/bridge/sp_test)
At this point you should begin familiarizing yourself with the use of the OSGi console to manage the platform.

Here are a couple of Eclipse projects that might help get you started using the OSGi Http Service:

You might also see if you can install and start the http-console bundle described here.

Configuration

The servletbridge web.xml provides a couple of initial parameters:

Extending

Currently there are two approaches for extending the basic installation:

  1. Write a bundle that uses the OSGi HttpService registered by org.eclipse.eqinox.servletbridge.http
  2. Write a bundle that adds extensions from org.eclipse.equinox.http.registry
The functionality offered by either approach is very similar. The extension points in org.eclipse.equinox.http.registry are simply a mapping of the OSGi HttpService.

Build Information

The current eclipse build tools and wizards do not directly support building this style of application so for the time being the build is performed with a series of Ant scripts and resource templates

At a high-level the idea is to create a WAR file structured as follows:

The above structure is meant to be very close to an RCP application with the /eclipse directory holding something similar to an RCP application (but naturally containing components more suitable for server side interaction).

A reasonable way to think of the build is to divide into two initial pieces:
  1. The web-app portion (based on the servletbridge)
  2. The eclipse portion
These two pieces should then be combined by placing the eclipse portion in the "/eclipse" directory.

org.eclipse.equinox.servletbridge contains an ant script in "/scripts/webAppBuilder.xml" that can be used from the IDE for constructing the war file structure above. (It can also be used for a head-less build by customizing various properties) Additionally "/tempates" provides the resource content like the web.xml, launch.ini, and config.ini which might also be customized.

To create the WAR file's contents from the Quickstart section:

  1. Synch the following project from the equinox-incubator CVS site
    • org.eclipse.equinox.servletbridge.feature
  2. Right-Click on the webAppBuilder.xml script in the IDE and "Run Ant".
    (Note: So that the pde.exportFeatures task is available in the IDE select "Run in the same JRE as the workspace" on the JRE tab from "Run Ant..")

As with RCP applications there are a wide variety of possible configurations. What's given in org.eclipse.equinox.servletbridge.feature is just one possibility.

 

Server links