Converting an EJB JAR file to an OSGi EJB bundle

When converting an enterprise archive (EAR) file to an enterprise bundle archive (EBA) file, you complete manual tasks to convert any enterprise bean (EJB) Java archive (JAR) files in the EAR file to OSGi EJB bundles.

To convert an EJB JAR file to an OSGi application bundle, complete the following steps:
  1. Define general bundle metadata by adding the following headers to the bundle manifest file, META-INF/MANIFEST.MF:
    Bundle-ManifestVersion
    The version of the syntax in which the bundle manifest file is written. For OSGi Service Platform Release 4, set the value to 2.
    Bundle-Name
    A human-readable name for the bundle.
    Bundle-SymbolicName
    A non-localizable name that identifies the bundle uniquely.
    Bundle-Version
    The version of the bundle. For more information, see the description of the Bundle-Version header in the bundle manifest file.
    Import-Package
    The external packages on which the bundle depends. For more information, see the description of the Import-Package header in the bundle manifest file.
    Export-Package
    The packages that are visible outside the bundle. For more information, see the description of the Export-Package header in the bundle manifest file.
  2. Define bundle-type-specific metadata by adding the following headers to the bundle manifest file:
    Export-EJB
    The presence of this header identifies the bundle as containing enterprise beans that are to be loaded and run by the EJB container. Optionally, you can specify, as the value of the this header, the list of enterprise beans that you want to export as OSGi services. For more information, see the description of the Export-EJB header in the bundle manifest file.