Using Rational J2C data bindings in an OSGi JVM server

The J2C tooling in Rational Application Developer for WebSphere (RAD) can create CICS®/IMS Java™ data bindings for accessing structured record data such as COBOL copybooks. J2C data bindings are created offline in the RAD environment, and then can be used in any Java runtime such as a CICS JVM server or WebSphere Application Server.

When used in CICS this scenario is an example of using OSGi enabled interfaces in the development environment that need to be added to the CICS JVM server environment. This is because the J2C tooling has a runtime dependency on the marshall.jar plug-in that is supplied with RAD. Perform the following steps to use the J2C data bindings in an OSGi JVM server.
  1. Create the J2C data bindings using the wizard File > New > J2C > CICS/IMS Java Data Binding in RAD.
  2. Import the required packages into your application by using the necessary OSGi Import-Package statements, for example: Import-Package: com.ibm.etools.marshall, com.ibm.etools.marshall.util, javax.resource.cci.

  3. Locate the redistributable marshall.jar from your RAD installation. It is usually located in the SDPShared\plugins\com.ibm.ccl.commonj.connector.metadata_nnn\runtime folder.
  4. Either wrapper the marshall.jar as an OSGi bundle and deploy to CICS as a middleware bundle, or add a Bundle-ClassPath: statement to the OSGI bundle manifest to make the packages in this JAR available to your application, as it is not provided by CICS or the z/OS Java SDK.
Note: The Streamable and Record interfaces from javax.resource.cci that are required by J2C are exported from the system bundle within the CICS JVM server environment. They do not need to be added in the same manner as used here for marshall.jar.

For more information, see Building Java Records from COBOL with Rational J2C tooling.