Lesson 1: Create the bundle and application
An OSGi bundle is a Java™ archive file that contains Java code, resources, and a manifest that describes the bundle and its dependencies. An OSGi bundle contains the business logic and metadata that you need to run a service. A bundle is a module in an application, which in turn is deployed to a server.
About this task
An OSGi application project groups a set of bundles to provide a coherent business logic. The application can consist of different bundle types such as web enabled bundles and persistence (JPA) enabled bundles.
In this lesson, you create an OSGi bundle that contains OSGi Blueprint information that defines a service that provides a plain old Java object (POJO) component assembly model. A POJO is an ordinary Java object, as distinguished from a special Java object, such as an enterprise entity bean.
To create the bundle, CounterServiceBundle:
Procedure
Results
Your OSGi bundle project is created and a bundle manifest is added to your project. Your OSGi application project is also created and your application manifest is added to the project. The application manifest file contains metadata that enables the OSGi Framework to process the modular aspects of the bundles. For more information about the OSGi application manifest file, see Application manifest files.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CounterServiceBundle
Bundle-SymbolicName: CounterServiceBundle
Bundle-Version: 1.0.0
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
The OSGi
bundle manifest file contains metadata that enables the OSGi Framework
to process the modular aspects of the bundle. For more information
about the OSGi bundle manifest file, see OSGi bundle manifest file. Application-Name: CounterApp
Application-SymbolicName: CounterApp
Application-ManifestVersion: 1.0
Application-Version: 1.0.0
Manifest-Version: 1.0
Application-Content: CounterServiceBundle;version=1.0.0,
Application-SymbolicName is the OSGi application name. Application-Content lists the bundle names with the acceptable range of OSGi version specifications. In this tutorial, the bundle CounterServiceBundle is tolerated with a version of 1.0 or later.
For more information about the OSGi application manifest file, see Application manifest files.
Lesson checkpoint
You created the CounterServiceBundle bundle and the CounterApp application.
- How to create an OSGi bundle project and OSGi application project.
- About the bundle manifest file.
- About the application manifest file.