Deploying the JCICS examples

You can use the example CICS® bundle in the IBM® CICS SDK for Java™ to deploy the JCICS examples to a CICS region.

Before you begin

You must create the JCICS example projects, as described in Creating the JCICS examples.

About this task

CICS loads and runs Java applications from zFS, so you must deploy your compiled applications to a suitable directory in zFS. You can create a suitable directory in zFS by using the z/OS® perspective in CICS Explorer®. CICS must have read and execute access to the directory.

The IBM CICS SDK for Java provides support for deploying Java applications in a CICS bundle project to zFS. A CICS bundle project groups a set of OSGi bundles together that are logically deployed and managed as a single unit. You can use the example CICS bundle projects, CICS Bundle JDBC Example and CICS Bundle OSGi Example, to deploy the JCICS examples to a CICS region.

Important: If you are using IBM CICS Explorer or an Eclipse-based IDE running version 2022-03 or later, your default compiler compliance level must match the Java version of the target runtime to which the application or sample is deployed to avoid issues. You can change this setting in IBM CICS Explorer by selecting Preferences, then Java, and then Compiler.

Procedure

  1. Open the com.ibm.cics.sever.examples.web.osgibundle file to check its contents.
    This file is in XML format and contains the symbolic name and version of the OSGi bundle. It also contains the name of a sample JVM server. The JVM server is the runtime environment for Java applications in CICS. When you create your own applications, you must provide the name of the target JVM server in this file.
  2. Deploy the CICS bundle projects to zFS.
    You need to perform this step for the com.ibm.cics.server.examples.bundle CICS bundle project and the com.ibm.cics.server.examples.jdbc CICS bundle project, respectively.
    1. Right-click the com.ibm.cics.server.examples.bundle CICS bundle project and select Export Bundle Project to z/OS UNIX File System.
    2. Select Export to a specific location in the file system and click Next.
    3. Enter your FTP credentials if required.
      If you have not previously set up a connection, you must create a connection to a target host machine.
    4. Browse to a directory where you want to deploy the CICS bundle and click Finish.
      The CICS bundle is deployed in the specified directory.

    Repeat steps 2.a through 2.d for the com.ibm.cics.server.examples.jdbc CICS bundle project.

  3. Open the CICS SM perspective. In the CICSplex Explorer view, select the CICS region where you want to run the JCICS example programs.
  4. Open the JVM Server Definitions view by clicking Definitions > JVM Server Definitions.
    This view lists all the JVMSERVER definitions for the CICS region.
  5. In the CSD Resource Groups view, select the supplied DFH$OSGI group.
    If this view is not open, select Window > Show view, and then select CSD Resource Groups and press Open to open it in the Eclipse perspective.
    The JVM Server Definitions view is filtered to display the DFHJVMS resource definition.
  6. Right-click DFHJVMS in the JVM Server Definitions view, and select Install to install this JVMSERVER resource.
    The resource creates a sample JVM server in the CICS region that contains an OSGi framework. This resource name matches the name of the JVM server that was specified in the manifest of the CICS bundles. You can check the status of the JVM server by clicking Operations > Java > JVM Servers.
  7. Open the Bundle Definitions view by clicking Definitions > Bundle Definitions.
    The Bundle Definitions view is filtered to show the DFH$OSGB and JDBC BUNDLE resource definitions in the group DFH$OSGI.
  8. Copy both BUNDLE resource definitions to a new group to edit the attributes:
    1. Select both the DFH$OSGB and JDBC resource definitions, right-click and then select Copy.
    2. Right-click anywhere in the CSD Resource Groups view and select Paste.
    3. Enter a new group name and click OK.
    4. In the CSD Resource Groups view, select the new group.
      The Bundle Definitions view changes to show the new BUNDLE definitions.
    5. Edit both BUNDLE resource definitions in the new group to change the bundle directory to match the location where you deployed the respective CICS bundle projects at step 2.d.
  9. In the Bundle Definitions view, select both the DFH$OSGB and JDBC resource definitions, right-click and select Install to install the BUNDLE resources.
    You can check that both BUNDLEs are installed in the ENABLED state by clicking Operations > Bundles. You can also check the list of OSGi bundles by clicking Operations > Java > OSGi Bundles.
  10. Update the JVM profile as follows:
    1. Update the OSGI_BUNDLES option to list the Db2 driver jar files.
      OSGI_BUNDLES=<path_to_Db2_JDBC_install_dir>/jdbc/classes/db2jcc4.jar,
      <path_to_Db2_JDBC_install_dir>/jdbc/classes/db2jcc_license_cisuz.jar,\

      where <path_to_Db2_JDBC_install_dir> is the installation path of the Data Driver for Db2.

      For example, if you used the default installation path for Db2 12, specify the OSGI_BUNDLES option as follows:
      OSGI_BUNDLES=/usr/lpp/db2v12/jdbc/classes/db2jcc4.jar,
      /usr/lpp/db2v12/jdbc/classes/db2jcc_license_cisuz.jar,\
    2. Add the following LIBPATH_SUFFIX statement:
      LIBPATH_SUFFIX=<path_to_Db2_JDBC_install_dir>/jdbc/lib
      Again, if you used the default installation path for Db2 12, specify the LIBPATH_SUFFIX statement as follows:
      LIBPATH_SUFFIX=/usr/lpp/db2v12/jdbc/lib
  11. To run the examples in a JVM server, install the DFH$OSGI sample group in the CICS region.
    This group contains the resource definitions for all the samples. The two sample BUNDLE resources and the same JVMSERVER resource are not installed because you have already created resources of the same name at step 9.
    When you install the group, CICS creates the resources that are required to run the examples.
  12. Compile and link-edit the supplied C programs, DFH$LCCA and DFH$LCCC, which are used by the program control examples, into a DFHRPL library.

Results

You successfully deployed the example CICS bundle to zFS and created the CICS resources that are required to run the JCICS examples.

What to do next

You can run the JCICS examples, as described in Running the JCICS examples.