Do you have Java applications running in pooled JVM? Are you considering the upgrade to CICS TS V5? If so then this article should help to smooth the migration of those applications.
The introduction of JVM server in CIC TS V4.2 offers a number of advantages over the existing pooled JVM implementation. The multi-threaded industry standard environment allows a single JVM within a CICS region to host all Java workload previously handled by a pool as well as the opportunity to consolidate multiple application regions. The OSGi framework brings further advantages including the ability to add, update or remove an application from a JVM without having to restart it.
Moving to this more scalable and dynamic environment does require a few changes including repackaging you application. We strongly recommend doing the migration on V4.2 before upgrading to V5 where pooled JVM is not supported (if you have V4.1 where JVM server is not available then consider using the CICS Developer Trial). The checklist we have put together will link you to the documentation you need as well as the experience gained by other customers.
Part 1 - Setting up the environment
Download, install and configure the CICS Explorer or CICS Explorer SDK. The latest versions can be downloaded from the CICS Explorer home page and will work with any supported version of CICS TS. See 6.1.1 “Set the target platform” in CICS and the JVM server Developing and Deploying Java applications.
Setup an OSGi JVM server. You will need to customize the appropriate sample profile and install a JVM server definition. See Configuring a JVM server for an OSGi application and 3 “Setting up a Java virtual machine server” in CICS and the JVM server Developing and Deploying Java applications.
Deploy the JCICS examples. Several sample applications are included with the CICS Explorer. Deploying these will ensure you have the correct zFS permissions. See 4.2 “The deployment process” in CICS and the JVM server Developing and Deploying Java applications.
Deploy the JDBC examples. If you use DB2 you will want to test database configuration and connectivity. See 9 “Accessing DB2 by using JDBC and SQLJ” in CICS and the JVM server Developing and Deploying Java applications.
Configuring MQ. If you use MQ see Using the WebSphere MQ classes for Java with a CICS JVM server.
Part 2 – Migrating your application
Run the CICS JVM Application Isolation Utility. The JVM server is a multi-threaded environment and some applications written for pooled JVM may not run correctly without change. See 10.6 “Thread-safe Java applications” in CICS and the JVM server Developing and Deploying Java applications.
Repackaging your application as OSGi bundles. The Eclipse Plug-in Development Environment (PDE), which is used for developing OSGi applications, offers several different approaches for converting either an existing binary JAR file into an OSGi bundle or converting source code projects. See 10.4 “Converting from a JVM pool to a JVM server” in CICS and the JVM server Developing and Deploying Java applications.
Check for 3rd party frameworks. Some frameworks and libraries such as Spring and Log4j make use of dynamic class loading. An application that worked in pooled JVM may not in JVM server. We have recently released APAR PI25045 to assist with migration of applications to the OSGi environment and an upcoming article on this blog will report on our experience.
Deploy your application to the JVM server. The CICS Explorer greatly simplifies this process but you will need to validate whether you have configured all the necessary application dependencies in the JVM server profile. See 3.1.4 “JVM server profile for user applications” in CICS and the JVM server Developing and Deploying Java applications. If you have chosen either the “injection” or the “conversion” packaging method you can also re-deploy your application to pooled JVM to verify that any changes you have made don’t affect execution.
Part 3 – Managing your application
Automating deployment. The steps in Parts 1 & 2 all use CICS Explorer to deploy the application. CICS offers a number of APIs to help you automate the process. We have recently released APAR PI24367 to assist with updating a Java application in production, and this CICSdev article explains how you can use this to automate the phasein of a Java application into a running JVM server.
Performance tuning. In contrast to the pooled JVM the multi-threaded JVM server environment supports the use of standard tools. See Integrating IBM Health Center and CICS Explorer. There are also several chapters in the IBM Knowledge Center including JVM server and pooled JVM statistics and Improving JVM server performance.
Problem determination. See CICS diagnostic tools for Java in the IBM Knowledge Center and Configuring CICS and CICS Explorer SDK to remotely debug Java applications.
This checklist will evolve as we learn more from you. Please also look at for follow-up articles on this blog covering some of the steps in more detail. For more information about JVM server and OSGi please see the following
- Running Java workloads with JVM servers and OSGi white paper
- IBM Knowledge Center for CICS TS