You can deploy a Java™ web
application that is packaged as a CICS® bundle
in a Liberty JVM server.
Before you begin
The Java web application, either in the form of WAR files,
EAR files or an EBA file, must be deployed as a CICS bundle
in zFS. The target JVM server must be enabled in the CICS
region.
For general information about creating and repackaging Java
applications, see Developing applications using the CICS Explorer
SDK.
If you have dependencies on an OSGi bundle that contains a library of common code, install the
bundle into the Liberty bundle repository, see Deploying OSGi bundles in a JVM server.
About this task
The CICS application model is to package Java application components in CICS bundles and deploy them to zFS. By installing the CICS bundles, you can manage the lifecycle of the application components. A Java web application contains one or more WAR files that provide the
presentation layer and business logic of the application, an OSGi application project, exported to
an EBA file, which contains a web-enabled OSGi bundle project to provide the presentation layer and
a set of further OSGi bundles that provide the business logic, or an Enterprise Archive (EAR) file
containing one or more WAR files that provide the presentation layer and business logic.
Procedure
- Create a BUNDLE resource that specifies the directory of the bundle in zFS:
- In the CICS SM perspective, click
in the CICS Explorer® menu bar to open the Bundles
Definitions view.
- Right-click anywhere in the view and click New to open the New
Bundle Definition wizard.
Enter the details for the BUNDLE resource in the wizard
fields.
- Install the BUNDLE resource.
You can install the resource in an enabled or
disabled state:
- If you install the resource in a DISABLED state, CICS
does not attempt to install the web applications into the Liberty server.
- If you install the resource in an ENABLED state, CICS
installs the web applications (WAR, EAR, EBA files) in the
${server.output.dir}/installedApps directory and adds an <application> entry
into ${server.output.dir}/installedApps.xml.
- Optional: Enable the BUNDLE resource to start the web applications in the
Liberty server, if the resource is not already in an ENABLED state.
- Click in the CICS Explorer menu bar to open the Bundles view.
Check the state of the BUNDLE resource.
- If the BUNDLE resource is in an ENABLED state, CICS
installed all the resources in the bundle successfully.
- If the BUNDLE resource is in a DISABLED state, CICS
was unable to install one or more resources in the bundle.
If the BUNDLE resource failed to install in the enabled state, check the bundle parts
for the BUNDLE resource. If any of the bundle parts are in the UNUSABLE state, a message is issued
to explain the cause of the problem. For example, this state can indicate that there is a problem
with the CICS bundle in zFS, or the associated
JVMSERVER resource is not available. You must discard the BUNDLE resource,
resolve the reported issue, and then install the BUNDLE resource again.
- Optional: To run web application requests on an application transaction, you
can create URIMAP and TRANSACTION resources.
Defining a URI map is useful if you want to
control security to the application, because you can map the URI to a specific transaction and use
transaction security. Typically, these resources are created as part of the CICS bundle and are managed with the application. However, you can choose to
define these resources separately if preferred.
- Create a TRANSACTION resource for
the application that sets the PROGRAM attribute to DFHSJTHP.
This CICS program handles the security checking of
inbound web requests to the Liberty JVM server. If you set any remote attributes, they are ignored
by CICS because the transaction must always attach in the
local CICS region.
- Create a URIMAP resource that has a
USAGE type of JVMSERVER. Set the TRANSACTION attribute to the application transaction and set the
scheme to HTTP or HTTPS.
You can also use the USERID attribute to set a user ID. This value is
ignored if the application security authentication mechanisms are used. If no authentication occurs
and no user ID is set on the URI map, the work runs under CICS default user ID.
Results
The CICS resources are enabled, and the web
applications are successfully installed into the Liberty JVM server.
What to do next
You can test that the Java application is available
through a web client. To update or remove the application, see Administering Java applications.