You can use the example CICS® bundle in the IBM® CICS SDK for Java™ to deploy the JCICS examples to
a CICS region.
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
- 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.
-
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.
-
Right-click the com.ibm.cics.server.examples.bundle
CICS bundle project and select Export Bundle
Project to z/OS UNIX File System.
-
Select Export to a specific location in the file system and click
Next.
-
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.
-
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.
-
Open the CICS SM perspective. In the CICSplex Explorer
view, select the CICS region where you want to run the JCICS
example programs.
- Open the JVM Server Definitions view by clicking
.
This view lists all the JVMSERVER definitions for
the CICS region.
-
In the CSD Resource Groups view, select the supplied DFH$OSGI group.
If this view is not open, select , 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.
-
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 .
-
Open the Bundle Definitions view by clicking .
The Bundle Definitions view is filtered to show the DFH$OSGB and JDBC BUNDLE resource
definitions in the group DFH$OSGI.
-
Copy both BUNDLE resource definitions to a new group to edit the attributes:
-
Select both the DFH$OSGB and JDBC resource definitions, right-click and then select
Copy.
-
Right-click anywhere in the CSD Resource Groups view and select
Paste.
-
Enter a new group name and click OK.
- In the CSD Resource Groups view, select the new group.
The Bundle
Definitions view changes to show the new BUNDLE definitions.
- 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.
-
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 . You can also check the list of OSGi bundles by clicking .
- Update the JVM profile as follows:
- 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,\
- 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
-
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.
- 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.