EJB bundles

An EJB bundle is a bundle that contains EJBs and that can be deployed in an OSGi container. An EJB bundle is an OSGi bundle version of an EJB JAR file.

Note: EJB is not supported in OSGi applications on Liberty.

You use an EJB bundle in an OSGi application in much the same way that you use an EJB JAR file in a Java™ enterprise application. For example, you use EJBs to implement the business logic of your application.

An EJB bundle contains a manifest file, META-INF/MANIFEST.MF. This file contains the same minimum set of manifest headers that any OSGi bundle manifest contains (for example Bundle-SymbolicName and Bundle-ManifestVersion), plus the Export-EJB header; it is the presence of the Export-EJB header that identifies the bundle as an EJB bundle.

You use the manifest headers to describe your EJB bundle in OSGi terms, and to specify the support that you want from the OSGi Applications runtime environment. For example, you do not need to package dependencies inside an EJB bundle; you can instead specify these dependencies in a manifest header and have the runtime environment provision them for you.

If you use a deployment descriptor XML file to define your EJB metadata, then the file must be located at META-INF/ejb-jar.xml. Any IBM binding files must be located in the META-INF folder; for example, META-INF/ibm-ejb-jar-bnd.xml.

You can convert an existing EJB JAR file to an EJB bundle by adding OSGi metadata to the file; Rational® Application Developer provides tooling to help simplify this task.