Deploying OSGi bundles in a JVM server
To deploy a Java™ application in a JVM server, you must install the OSGi bundles for the application in the OSGi framework of the target JVM server.
Before you begin
The CICS bundle that contains the OSGi bundles for the application must be deployed to zFS. The target JVM server must be enabled in the CICS region.
About this task
A CICS bundle can contain one or more OSGi bundles. Because the CICS bundle is the unit of deployment, all the OSGi bundles are managed together as part of the BUNDLE resource. The OSGi framework also manages the lifecycle of the OSGi bundles, including the management of dependencies and versioning.
Ensure that all OSGi bundles that comprise a Java application component are deployed in the same CICS bundle. If there are dependencies between OSGi bundles, deploy them in the same CICS bundle. When you install the CICS BUNDLE resource, CICS ensures that all the dependencies between the OSGi bundles are resolved.
If you have dependencies on an OSGi bundle that contains a library of common code, create a separate CICS bundle for the library. In this case, it is important to install the CICS BUNDLE resource that contains the library first. If you install the Java application before the CICS bundles that it depends on, the OSGi framework is unable to resolve the dependencies of the Java application.
Do not attempt to install a CICS bundle that contains an OSGi bundle into a Liberty JVM server, as this configuration is not supported. Instead, you can either package the OSGi bundle together with your web application in an enterprise bundle archive (EBA), or you can use the WebSphere® Liberty bundle repository to make the OSGi bundle available to all web applications in the Liberty JVM server.
- If you use CICS Explorer® for Aqua 3.3 or later, IBM CICS SDK for Enterprise Java (Liberty) does not support WDT any more. Use an alternative solution such as CICS Explorer on Eclipse Marketplace, Gradle or Maven, as suggested in Consideration for OSGi applications when installing CICS Explorer in the CICS Explorer product documentation.
This tutorial provides step-by-step instructions on how to build a CICS bundle from an existing Java application that is already built by Gradle or Maven.
Procedure
Results
The BUNDLE is enabled, the OSGi bundles are successfully installed in the OSGi framework, and any OSGi services are active. The OSGi bundles are available to other bundles in the framework.
What to do next
You can make the Java application available to other CICS applications outside the OSGi framework, as described in Invoking a Java application in a JVM server.