This tutorial describes an installation of an OSGI server. The Apache Felix project will be used as the OSGI server environment.
First you have to download the server (download) and decompress the zip file. After that you go to the felix directory and starts the server with the following command.
java -jar bin/felix.jarNow you see the felix console. The help command show you a list of the possible commands. The ps command list all installed default bundles.
Accordingly you can use the the install command (install http://...jar or install file:///...jar) to fit new bundles. At the Felix download page you will find all standard OSGI bundles as the LogService or HttpService.
If you want to use a WAR extender how PAX Web, you have to enter the following commands.
-> install http://repository.ops4j.org/maven2/org/ops4j/pax/web-extender/pax-web-ex-war/0.5.1/pax-web-ex-war-0.5.1.jar Bundle ID: 4 -> install http://repository.ops4j.org/maven2/org/ops4j/pax/web/pax-web-service/0.6.0/pax-web-service-0.6.0.jar Bundle ID: 5 -> install http://repository.ops4j.org/maven2/org/ops4j/pax/web/pax-web-jsp/0.6.0/pax-web-jsp-0.6.0.jar Bundle ID: 6 -> install http://apache.atviraskodas.com/felix/org.apache.felix.configadmin-1.0.10.jar Bundle ID: 7 -> install http://repository.ops4j.org/maven2/org/ops4j/pax/logging/api/0.9.5/api-0.9.5.jar Bundle ID: 8 -> install http://apache.atviraskodas.com/felix/org.apache.felix.eventadmin-1.0.0.jar Bundle ID: 9 -> start 4 5 6 7 8 9
Now you can access your webcontainer (http://localhost:8080). For the deployment of standard WAR's you need an adapted and OSGIfied MANIFEST.MF. The Felix Maven plugin (BND Plugin) will help you. Two examples you can check out here:
svn co https://scm.ops4j.org/repos/ops4j/laboratory/users/ceefour/cxf-osgi-sampleRegards
Rafael Sobek
Technorati Tags: OSGI Container Felix Installation
