OSGi Hello World

This sample demonstrates how to create a simple OSGi application and run it on WebSphere® Application Server. The OSGi application consists of an OSGi web bundle that contains a servlet and an activator that identifies the lifecycle of the bundle in the Console view. This sample is an introduction to using OSGi application development tools.

Tip: You can run this sample on WebSphere Application Server traditional Versions 7.0, 8.0, and 8.5. You can also run this sample on WebSphere Application Server Liberty.
Learn more about installing WebSphere Application Server Version 7.0: To run this sample on WebSphere Application Server traditional Version 7.0, you must install the Feature Pack for OSGi Applications and Java™ Persistence API 2.0. To Install the feature pack:
  1. Open the IBM® Installation Manager.
  2. Click Install. The Install Packages page opens.
  3. In the package list, select IBM WebSphere Application Server traditional Version 7.0 Test Environment, then click Next.
  4. Read the license agreements. Accept the license agreements then click Next.
  5. Follow the instructions in the Installation Manager to install WebSphere Application Server traditional Version 7.0.
  6. In the Features list, ensure that you select OSGi Applications under IBM WebSphere Application Server traditional Version 7.0 Feature Pack for OSGi Applications and Java Persistence API 2.0.
Learn more about installing WebSphere Application Server Version 8.0: To run this sample on WebSphere Application Server traditional Version 8.0, you must install the server:
  1. Open the IBM Installation Manager.
  2. Click Install. The Install Packages page opens.
  3. In the package list, select IBM WebSphere Application traditional Server Version 8.0, then click Next.
  4. Read the license agreements. Accept the license agreements then click Next.
  5. Follow the instructions in the Installation Manager to install WebSphere Application Server traditional Version 8.0.
Learn more about installing WebSphere Application Server Version 8.5: To run this sample on WebSphere Application Server traditional Version 8.5, you must install the server:
  1. Open the IBM Installation Manager.
  2. Click Install. The Install Packages page opens.
  3. In the package list, select IBM WebSphere Application Server traditional Version 8.5, then click Next.
  4. Read the license agreements. Accept the license agreements then click Next.
  5. Follow the instructions in the Installation Manager to install WebSphere Application Server traditional Version 8.5.
Learn more about installing WebSphere Application Server Liberty: To run this sample on WebSphere Application Server Liberty, you must install the server. See Installing Liberty for more information.
To deploy your OSGi Hello World application to a server:
  1. In Enterprise Explorer, expand HelloWorld > HelloWorld > Servlets.
  2. Right-click HelloServlet and select Run As > Run on Server. The Run On Server dialog opens.
  3. Click WebSphere Application Server from the list of servers and click Finish.

The string Hello OSGi World! is displayed in the browser.

Icon that indicates the type of topic Sample topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: helloworldExamples.html