Pax Web Extender - War - OSGi-fy

This page explains what it takes to make a standard war file deployable into OSGi. For detailed information read OSGi Service Platform Core Specification section 3.2 — Module Layer — Bundles. The pages specified bellow refers to Release 4, Version 4.1 April 2007.

The quickest way is for your project to use Maven and utilize Maven Bundle Plugin to generate OSGi manifest for your WAR project. See: http://wiki.ops4j.org/confluence/display/ops4j/Getting+the+benefits+of+maven-bundle-plugin+in+other+project+types

If you opt for a lower level way, read on...

First of all the war has to be a valid OSGi bundle. As minimum the war file must contain the following manifest headers in META-INF/MANIFEST.MF:

If you have this header, will suffice to deploy the war into OSGi. But this is not enough to have it working in most of the situations as OSGi has a very strict class loading policy. So next, you will have to specify how the classes you need in runtime will be found via the following headers:

Most likely the above headers will have to have the following values:

Now you are ready to deploy your war. If you still get class loading exceptions then is most likely that you did not include all the jars you need in the Bundle-ClassPath or Import-Package.

Preprocess

If you find this process hard to grasp or if you cannot change the manifest of your war or maybe you simple want to automate it take a look at how you can automate it in a [static] or [dynamic] way. You may also use War Protocol.


Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Activity
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

Other Features

Add Content


Click here to sign up for an account!
Clicky Web Analytics