When you think of CICS (CICS Transaction Server for z / OS), you might think that writing applications in languages such as COBOL, PL / I, and assembler is the mainstream, but Java support has been added for a long time. .. In more recent versions, Liberty (WAS: a lightweight version of WebSphere Application Server) runs on CICS. In other words, you can run Java EE applications on CICS.
For example, if you have an existing CICS application and want to create an interface for the Web to access it from the Web, you can do it with CICS alone without purchasing a separate application server.
Here is a summary of the minimum settings for running Liberty on CICS and the steps to run the sample application.
Basically, follow the description around here. https://www.ibm.com/support/knowledgecenter/SSGMCP_5.3.0/com.ibm.cics.ts.java.doc/JVMserver/config_jvmserver_liberty.html
Property information and logs of the Liberty server running on CICS are managed by files on USS. Therefore, first prepare the directories and files used by the CICS-Liberty feature on USS (Unix System Service).
Create the following directory.
Prepare a file to set the properties of Liberty and its prerequisite JVM.
This is because the template provided by the product is provided in
DFHWLP.jvmproperties
JAVA_HOME=/usr/lpp/java/J7.1_64/
WORK_DIR=/var/cicsts/cicsts53/CT53H4A1/work
WLP_INSTALL_DIR=/usr/lpp/cicsts/cicsts53/wlp
-Dcom.ibm.cics.jvmserver.wlp.autoconfigure=true
-Dcom.ibm.cics.jvmserver.wlp.server.host=*
-Dcom.ibm.cics.jvmserver.wlp.server.http.port=53481
-Dcom.ibm.cics.jvmserver.wlp.server.https.port=53482
Specify the Java JAVA_HOME to be used, the work directory, the port number that Liberty listens to, and so on.
SIT In the CICS region SIT, specify the directory of the property file prepared above with the JVMPROFILEDIR parameter.
SIT
JVMPROFILEDIR=/var/cicsts/cicsts53/CT53H4A1/JVMProfiles
Launch the CICS region with this SIT parameter enabled.
To run Liberty on CICS, you need to create and install a resource definition called JVMServer definition that specifies the property file prepared on USS. Again, a sample is provided for the DFH $ WLP group, so you can copy and use it.
JVM Server definition example
OBJECT CHARACTERISTICS CICS RELEASE = 0700
CEDA View JVmserver( DFHWLP )
JVmserver : DFHWLP
Group : TAGGRP
DEScription : CICS JVM server to run WLP samples
Status : Enabled Enabled | Disabled
Jvmprofile : DFHWLP (Mixed Case)
Lerunopts : DFHAXRO
Threadlimit : 015 1-256
DEFINITION SIGNATURE
DEFinetime : 01/29/16 09:08:50
CHANGETime : 01/29/16 09:08:50
CHANGEUsrid : CICSUSER
CHANGEAGEnt : CSDApi CSDApi | CSDBatch
CHANGEAGRel : 0700
The file with the extension ".jvmprofile" added to the value of Jvmprofile (DFHWLP in the above example) specified here is searched from the directory specified by JVMPROFILEDIR of SIT.
After creating the JVMServer definition, let's install it. Then, the following message is output to the CICS JOBLOG.
DFHRD0131 I 03/07/2017 19:14:04 CT53H4A1 TCP00045 CICSUSER CEDA INSTALL JVMSERVER(DFHWLP)
0045 CEDA CICSUSER 03/07/17 19:14:04 INSTALL JVMSERVER(DFHWLP) GROUP(TAGGRP)
DFHPG0210 03/07/2017 19:14:04 CT53H4A1 IBMUSER CJSR Resource definition for DFHAXRO has been system autoinstalled.
DFHSJ0207 03/07/2017 19:14:09 CT53H4A1 JVMSERVER DFHWLP is running Java version 1.7.1.
DFHSJ0919 I 03/07/2017 19:14:17 CT53H4A1 IBMUSER JVMSERVER DFHWLP is processing any queued bundles.
DFHSJ0915 03/07/2017 19:14:17 CT53H4A1 IBMUSER JVMSERVER DFHWLP is now enabled and is ready for use.
DFHSJ0901 I 03/07/2017 19:14:17 CT53H4A1 JVMSERVER DFHWLP Java full version is: JRE 1.7.0 IBM J9 2.7 z/OS s390x-64 Compressed
References 20140410_195893 (JIT enabled, AOT enabled) J9VM - R27_Java727_SR1_20140410_1931_B195893 JIT -
tr.r13.java_20140410_61421 GC - R27_Java727_SR1_20140410_1931_B195893_CMPRSS J9CL - 20140410_195893.
The Liberty server is now up on CICS!
If you check the information of the port you are listening to with the NETSTAT command etc., you can see that you are listening on the port specified in the property file earlier.
NETSTAT example
398 00000090 CT53H4A1 000015DC 0.0.0.0..53481 0.0.0.0..0 LISTEN
398 00000090 CT53H4A1 000015DD 0.0.0.0..53482 0.0.0.0..0 LISTEN
The Liberty server is running on CICS, so let's connect from your browser. You can see the home screen by accessing http: // hostname: 53481 /.
Furthermore, if you access the web application provided by default, you can check the following environmental information.
This completes the minimum execution environment. It's easy.
The description of this area is the base. https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.3.0/com.ibm.cics.ts.java.doc/topics/installingthelibertyprofile.html
By the way, even a CICS application develops a JavaEE application that runs on Liberty, so the development environment is not the 3270 screen of PCOM, but of course Eclipse on the PC. An SDK plug-in for CICS-Liberty is provided for Eclipse, so you can create a development environment by adding it. You can use any of the free Eclipse (although version integrity is required), but CICS provides an Eclipse-based management tool (free) called CICS Explorer, so that's it. It's a good idea to get and put the SDK in it.
CICS Explorer Refer to the following description ... Installing CICS Explorer (https://www.ibm.com/support/knowledgecenter/SSGMCP_5.3.0/com.ibm.cics.core.help/topics/concepts/install_planning.html)
There are two ways to install it, and it may be difficult to understand if Eclipse is installed in advance or z / OS Explorer is installed, but the quickest way is at the bottom of the following site. Select Option 1 Starting from Scrach in "Using Eclipse (p2)" to download the CICS Explorer for your platform. https://developer.ibm.com/mainframe/products/downloads/eclipse-tools/#p2 Now that you have a zip, just unzip it. When you unzip it, there is zosexplorer.exe, so execute it and start it. (Even if you download CICS Explorer, the executable file is zosexplorer.exe.)
Refer to the following description ... Installing the CICS SDK for web and JSP
From the CICS Explorer menu, select Help--Install New Software IBM Explorer for z / OS Update Site-Select http://public.dhe.ibm.com/ibmdl/export/pub/software/htp/zos/tools/aqua/.
You need to be connected to the web as it will be downloaded and installed from the website.
Expand IBM CICS Explorer and select and install the IBM CICS SDK for Servlet and JSP support, IBM CICS SDK for Servlet and JSP translation support.
Make some settings to improve the development environment.
On Eclipse (CICS Explorer), specify which version of CICS you want to target for development. Select a setting, Plugin Development-Select a target platform and Select the target CICS version. (Here CICS TS V5.3 with Liberty and PHP)
If you want to deploy your application from CICS Explorer to the target CICS, you need to transfer your application over USS. Create an FTP connection configuration so that you can deploy from CICS Explorer. Open the Host Connection view and define the FTP configuration in the z / OS FTP section.
If you can make an FTP connection from CICS Explorer, it will be marked in green as shown below.
Prepare a directory on USS to place the application. The CICS-Liberty application is associated with a resource called BUNDLE definition on CICS, so create a directory called bundles as shown below. /var/cicsts/cicsts53/CT53H4A1/bundles/
Now that the development environment is in place, let's create a sample app project provided by the CICS SDK, deploy it on CICS-Liberty, and run it.
Refer to the following description ... Creating the servlet examples
From File-New-Sample, select CICS Hello World.
The CICS Hello World sample app project is now imported into Eclipse. It's as simple as an app with just one jsp.
It also contains a CICS Bundle definition (cics.xml) for managing as a resource on CICS.
Refer to the following description ... Deploying the servlet examples
Let's deploy this app. Right-click on the project named xxx.bundle and select Export Bundled Project to z / OS UNIX File System.
Select Export to a specific location in the file system and Next
Select the deployment destination directory prepared above and export it.
The app is now placed on USS.
Finally, in order for this app to be recognized by CICS, add a resource definition called BUNDLE definition on CICS. The BUNDLE definition for this sample is provided in the DFH $ WLP group, so copy it, edit it accordingly, and install it.
BUNDLE definition example
OVERTYPE TO MODIFY CICS RELEASE = 0700
CEDA ALter Bundle( WLPHELLO )
Bundle : WLPHELLO
Group : TAGGRP
DEScription ==> CICS Bundle for Liberty Hello servlet
Status ==> Enabled Enabled | Disabled
BUndledir ==> /var/cicsts/cicsts53/CT53H4A1/bundles/com.ibm.cics.server.
(Mixed Case) ==> examples.wlp.hello.bundle_1.0.1
==>
==>
==>
BAsescope ==>
(Mixed Case) ==>
==>
==>
==>
DEFINITION SIGNATURE
DEFinetime : 03/07/17 21:02:49
CHANGETime : 03/07/17 21:04:26
SYSID=H4A1 APPLID=CT53H4A1
The following message is output to the CICS JOBLOG.
+CWWKG0016I: Starting server configuration update.
+CWWKG0017I: The server configuration was successfully updated in 636
0.031 seconds.
+CWWKZ0001I: Application com.ibm.cics.server.examples.wlp.hello.war 637
started in 0.069 seconds.
Let's access the application deployed on CICS-Liberty from a browser.
Access the following URL from your browser http://hostname:53481/com.ibm.cics.server.examples.wlp.hello/
It is OK if the application returns the following screen. You can see that the CICS region name (applid) is returned.
Here we have introduced a series of steps to get the CICS-Liberty app working. Although I haven't stepped into the contents of the app, the CICS-Liberty app provides a Java interface equivalent to the EXEC CICS API called JCICS, so you can access CICS resources directly from Java. By using this CICS-Liberty feature, it may be easier to utilize existing CICS apps from the Web and develop extensions in Java.
Recommended Posts