Jetty has moved!
Jetty is a project at the Eclipse Foundation.
Homepage:http://www.eclipse.org/jetty
Downloads: http://download.eclipse.org/jetty/
Documentation:http://www.eclipse.org/jetty/documentation/current/
About:http://www.eclipse.org/jetty/about.php
Jetty Powered:http://www.eclipse.org/jetty/powered/
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

OSGi Tips

As of release 6.1.5, Jetty ships with jar file manifests that include appropriate OSGi bundle information. This means that you can import the jetty jars into an OSGi framework and use them, for example, to build a HTTP service.

The jetty jars whose manifests include OSGi bundle information are:

  • servlet-api-2.5.jar
  • jetty-util.jar
  • jetty.jar
  • jetty-management.jar
  • jetty-naming.jar
  • jetty-plus.jar
  • jetty-annotations.jar
  • jsp-api-2.1.jar
  • jsp-2.1.jar

Using jetty jars in Equinox

The jetty bundles mostly have dependencies amongst themselves (loosely in the order listed above), although the jetty-naming.jar and the the jsp jars do have external dependencies.

If you are using Equinox, it is quite easy to resolve these dependencies. Here's an Equinox config.ini file with all the external dependencies already setup up so that they will be loaded at start up time. Assuming you downloaded the config.ini file to /tmp, here's a quick way to start up Equinox 3.3 with this config.ini file:

If you want to store the config.ini file somewhere else, then you need to include it's location on the command line:

There are more instructions on the Eclipse Equinox website on how to start Equinox.

Now you should be running Equinox, and you should see a prompt like so:

To see the state of all the bundles which are currently enabled, do:

You'll see output something like the following:

You can now go ahead and import the jetty jars. This is a matter of using the install command to load each of them. Assuming I have jetty 6.1.5 installed in /home/janb/src/jetty-6.1.5, I install the servlet-api-2.5 jar and check on it's status by doing:

The final step is to start that jar so that it is available to the OSGi environment:

Rinse and repeat for all the jars we listed at the top of this article and you will have successfully imported the jetty jars into OSGi.

  • No labels
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery