Develop a simple OSGi application

This tutorial demonstrates how to create an OSGi application and run it on either WebSphere® Application Server traditional or Liberty. The OSGi application consists of an OSGi web bundle that contains a servlet that accesses a service that is provided in another bundle project. This tutorial is an introduction to using OSGi application development tools.

Learning objectives

In this tutorial, the following learning objectives are met:
  • Create an OSGi bundle and an OSGi application.
  • Create and configure an OSGi blueprint configuration file.
  • Configure component dependencies.
  • Add dependency injection within a bundle.
  • Add dependency injection between bundles.
  • Deploy an OSGi application to a server.

Time required

This tutorial takes approximately 90 minutes to finish. If you explore other concepts that are related to this tutorial, it might take longer to complete.
Related informationSample: OSGi Counter ServiceThis sample demonstrates how to declare services in the blueprint file of a bundle, which makes it accessible by other bundles in the application. The OSGi application consists of an OSGi web bundle that contains a servlet that accesses a service that is provided in another bundle project. The application runs on either WebSphere Application Server traditional or Liberty. This sample is an introduction to using OSGi application development tools.