Enable OSGi Applications with Java EE 7 technologies

You can enable OSGi Applications with key Java™ Platform, Enterprise Edition (Java EE) 7 technologies. WebSphere® Application Server Liberty Version 8.5.5.6 and later, is a production ready server certified for Java EE 7 Full Platform.

Stabilized feature: Support for OSGi applications is stabilized. Java Platform, Enterprise Edition (Java EE) 8 technologies are not enabled for OSGi applications and features that support OSGi development. As an alternative, develop applications by using the Java Platform, Enterprise Edition (Java EE) or Microprofile features. For more information, see Stabilized Liberty features and feature capabilities.

To achieve zero migrations, new features are created and existing features remain unaltered. For example, when support for servlet 3.1 was added, a servlet-3.1 feature was created, and servlet-3.0 was kept to ensure behavior did not change for an existing server deployment.

In an environment before Java EE 7 support, you were required to configure blueprint-1.0, or something that depends on it, to be able to deploy OSGi applications. You then either configured other OSGi-specific features, like wab-1.0, or generic ones, like jpa-2.0, to get other capabilities.

In a Java EE 7 environment, OSGi configuration is in two steps:
  1. Decide you want to deploy OSGi Bundles.
  2. Decide what technologies you want to use to implement those OSGi Bundles.

Telling the server you want to deploy OSGi Bundles

The first step is to add the osgiBundle-1.0 feature to your server.xml:
<featureManager> 
    <feature>osgiBundle-1.0</feature>
</featureManager>
Adding the osgiBundle-1.0 feature enables OSGi Bundles to be deployed as part of an OSGi application.

Telling the server what component models you want to use

Rather than having OSGi-specific features, like wab-1.0, you now configure the same component models you would for Java EE. This configuration enables the use of servlets in Bundles, for example, Web Application Bundles or Http Whiteboard servlets:
<featureManager> 
    <feature>osgiBundle-1.0</feature> 
    <feature>servlet-3.1</feature>
</featureManager>
For more information, see OSGi Web Application Bundles and OSGi Http Whiteboard.
This server configuration adds the ability to use jpa-2.1 in a Persistence Bundle:
<featureManager> 
    <feature>osgiBundle-1.0</feature>
    <feature>servlet-3.1</feature> 
    <feature>jpa-2.1</feature>
</featureManager>
For more information, see Accessing data using Java Persistence API .
Optionally, you can still include blueprint-1.0:
<featureManager> 
    <feature>osgiBundle-1.0</feature>
    <feature>servlet-3.1</feature> 
    <feature>jpa-2.1</feature>  
   <feature>blueprint-1.0</feature>
</featureManager>

Which Java EE 7 component models are supported?

You can see the full list of Java EE 7 technologies that are enabled for OSGi applications.