For the latest information on upgrading to and from any versions of CICS TS, see CICS TS 5.5.

Upgrading Java applications in a JVM server

If you are running Java™ applications in a JVM server, when you upgrade you must check whether the applications use IBM® or vendor classes that are available in the JRE. The OSGi framework has stricter rules for loading classes and you might need to change your applications to run them in a JVM server in this release.

About this task

In previous releases, the OSGi framework was able to load IBM and vendor classes from the JRE as required by Java applications. However, in this release, the OSGi framework has stricter rules that control which classes can be loaded from the JRE.

Any package that is prefixed with java is loaded by the OSGi framework as required by the application. If an application uses an IBM or vendor package that is supplied with the JRE, such as com.ibm.misc, you must create a middleware OSGi bundle to make these classes available to the OSGi framework. If you do not change the application, transactions abend with an AJ05 code and java.lang.ClassNotFoundException errors are written to the JVM server error log and CICS® system log.

You do not need to complete these steps for the CICS Java classes, as the JCICS classes are automatically made available in the OSGi framework.

Procedure

  1. Check whether your application depends on IBM or vendor classes in the supplied JRE.
  2. For each IBM or vendor package that the application requires, create an OSGi bundle fragment to export the package. The following example shows what the manifest of the OSGi bundle fragment can contain:
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: Extension
    Bundle-SymbolicName: com.ibm.example.extension
    Bundle-Version: 1.0.0
    Bundle-Vendor: IBM
    Fragment-Host: system.bundle; extension:=framework
    Export-Package: com.ibm.misc
    Bundle-RequiredExecutionEnvironment: JavaSE-1.6

    The Fragment-Host defines that the OSGi bundle fragment extends the system bundle in the OSGi framework. The Export-Package lists the packages that are exported; in this example, the package beginning com.ibm.misc is exported. If you use Eclipse, ignore the error that is flagged.

  3. Change the application to add an import for the exported package in the appropriate OSGi bundle manifest. Each OSGi bundle that requires a class from an IBM or vendor package must declare the package in the manifest.
  4. Install the OSGi fragment bundle into the JVM server as a middleware bundle. Add the bundle to the OSGI_BUNDLES option in the JVM profile for the JVM server. Separate the middleware bundle from the application so that you can manage the lifecycle separately in CICS.
  5. Restart the JVM server to pick up the OSGi fragment.
  6. Deploy the updated application bundle to CICS.

Results

The OSGi bundle fragments are loaded when the OSGi framework is initialized. When the application is called, the application can access the IBM or vendor classes.



dfhe5_upgrade_jvmserver.html | Timestamp icon Last updated: Thursday, 27 June 2019