CICS-Run Java application-(4) Spring Boot application


CICS TS for z / OS supports running Liberty, so you can run Java EE applications on CICS. With support for Spring Boot from CICS TS V5.3, Spring Boot applications can now run on CICS (with Liberty on CICS). Running on CICS means that you can use JCICS, which uses CICS functions, so web apps that call existing CICS programs, web apps that access CICS-managed VSAMs and TSQs, etc., run only with CICS. It also means that you can develop it using the Spring Boot framework.

In this article, I will run a sample CICS-Spring Boot app provided on GitHub below. cics-java-liberty-springboot-jcics

Both Maven and Gradle can be used to manage builds, but here I will use Gradle.

Related article

CICS-Run Java application-(1) Run simple sample application CICS-Run Java application-(2) Build management by Maven CICS-Run Java application-(3) Build management with Gradle CICS-Run Java application-(4) Spring Boot application

Advance preparation

Development environment (PC)

Suitable Java EE development environment

Please use something that can develop Java EE applications such as Eclipse and VS Code as appropriate. Since we will use the sample as it is this time, we will not edit the source in particular, so we do not have to use it, but usually we will use some kind of development environment. It would be nice to be able to work with Gradle, git, etc. If you use CICS Explorer together, you can use Eclipse.

CICS Explorer

This is also not required, but it can be used to check the CICS resource definition. Download and set up an Eclipse-based tool called CICS Explorer, referring to the following areas. Reference: Downloading and starting CICS Explorer (

Gradle Follow the steps below to install. Installing Gradle Basically, just unzip the downloaded one and pass it through the path.

As a prerequisite, Java 8 or later is required.

c:\>java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Download the latest version of Gradle V6.5 at the moment from the following ( Releases

Extract it to a suitable directory. (Here (c: \ x \ Gradle \ gradle-6.5 ) Add the destination bin (C: \ x \ Gradle \ gradle-6.5 \ bin) to your PATH.


c:\>gradle -v

Gradle 6.5

Build time:   2020-06-02 20:46:21 UTC
Revision:     a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4

Kotlin:       1.3.72
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_144 (Oracle Corporation 25.144-b01)
OS:           Windows 10 10.0 amd64

This is OK.


I will get and use the sample provided on gitHub, so I also have git installed. The setup method is omitted because it is lying around.

c:\>git --version
git version

Execution environment (z / OS, CICS)

Prepare a CICS region to run the sample. For now, we'll use a region named ** CT56B4A1 ** under CICSplex control. Add a resource called JVMServer to run Java applications. This time, we will use the sample for CICS-Liberty (JavaEE application), so create a JVM Server for Liberty.

JVM profile

Prepare the JVM profile on USS. (Properties for the JVMServer are effectively specified in a file on this USS. The JVMSERVER resource definition points to the filename of this JVM profile.) A sample is provided, so copy it and use it.

Create a directory called /var/cicsts/cicsts56/CT56B4A1/JVMProfiles and copy /usr/lpp/cicsts/cicsts56/JVMProfiles/DFHOSGI.jvmprofile (sample definition for OSGi located under the CICS installation directory) to it. To do. Customize as appropriate for your environment.

DFHWLP.jvmprofile excerpt



Specify the directory where the above properties file is located in the SIT parameter "JVMPROFILEDIR".


Restart the region for the changes to take effect.

JVM Server definition

Prepare the JVMSERVER resource definition. Copy the JVMSERVER definition "DFHWLP" in the product-provided DFH $ WLP group to an appropriate group and install it.

OBJECT CHARACTERISTICS                                    CICS RELEASE = 0730
 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     : 06/04/20 16:20:21                                         
  CHANGETime     : 06/04/20 16:20:21                                         
  CHANGEUsrid    : CICSUSER                                                  
  CHANGEAGEnt    : CSDApi             CSDApi | CSDBatch                      
  CHANGEAGRel    : 0730                                                                     

It is OK if it is enabled by looking at CEMT I JVMSERVER.

I JVMS                                             
 Jvm(DFHWLP  ) Ena     Prf(DFHWLP  ) Ler(DFHAXRO ) 
    Threadc(005) Threadl( 015 ) Cur(48314096)           

Change server.xml

In this sample execution procedure, it is a procedure to deploy manually instead of automatically deploying, so add the setting for that.

If you specify = true in the JVM profile, Liberty is configured automatically. Once you have installed the JVMSERVER definition, Liberty will be configured under the work directory (work / CT56B4A1 / DFHWLP / wlp / usr / servers / defaultServer). Modify server.xml under this directory so that it looks like this:


<applicationMonitor dropins="dropins" dropinsEnabled="true" pollingRate="5s" updateTrigger="polled"/>

In this way, specify dropsEnabled = "true", updateTrigger = "polled". This will automatically detect the war placed in the drops directory. Create a drops directory in the same directory (... / work / CT56B4A1 / DFHWLP / wlp / usr / servers / defaultServer / drops).

After making changes, restart the JVM Server.

CICS Bundle Deployment API You must have set up the CICS Bundle Deployment API, which is available from CICS TS V5.6. (Not required for manual deployment of sample procedure) This feature was added for application deployment as one of the REST-based management APIs called CMCI. Set up CMCI on the WUI server that manages the target CICS region, and specify the parameters for the CICS Bundle Deployment API in the CMCI JVM server properties. Reference: How it works: CICS bundle deployment API

The minimum required settings are as follows. Create a directory on USS for Bundle file placement. Here, it is / var / cicsts / cicsts56 / bundles. Set the following parameters in the JVM profile (EYUCMCIJ.jvmprofile) for WUI's CMCI JVM Server.

Sample operation check (1) / Manual deployment

First, let's move it according to the procedure provided on github. Reference: cics-java-liberty-springboot-jcics

Local cloning

Create an appropriate directory and clone to your local PC.

c:\y\workspace\cicsts56>git clone
Cloning into 'cics-java-liberty-springboot-jcics'...
remote: Enumerating objects: 67, done.
remote: Counting objects: 100% (67/67), done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 67 (delta 12), reused 56 (delta 7), pack-reused 0
Unpacking objects: 100% (67/67), done.

Understanding file structure

Go to the directory "cics-java-liberty-springboot-jcics" and take a look at the structure of the file.

c:\y\workspace\cicsts56\cics-java-liberty-springboot-jcics>tree /f /a
List of folder paths:Volume Windows
Volume serial number is 1866-E2FC
|   .classpath
|   .gitignore
|   .project
|   build.gradle
|   gradlew
|   gradlew.bat
|   mvnw
|   mvnw.cmd
|   pom.xml
|   settings.gradle
|   \---wrapper
|           maven-wrapper.jar
|       org.eclipse.buildship.core.prefs
|       org.eclipse.wst.common.component
|       org.eclipse.wst.common.project.facet.core.xml
|   \---wrapper
|           gradle-wrapper.jar
        |   \---com
        |       \---ibm
        |           \---cicsdev
        |               \---springboot
        |                   \---jcics

It is a one-shot project of the application part. Does not include the CICS Bundle project. It seems that it supports both Maven and Gradle, but here I will use Gradle.

Check / edit contents

There are several sources, but let's take a look at, for example. This is just a look.

/* Licensed Materials - Property of IBM                                   */
/*                                                                        */
/* SAMPLE                                                                 */
/*                                                                        */
/* (c) Copyright IBM Corp. 2020 All Rights Reserved                       */
/*                                                                        */
/* US Government Users Restricted Rights - Use, duplication or disclosure */
/* restricted by GSA ADP Schedule Contract with IBM Corp                  */
/*                                                                        */



import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


public class WriteTSQController {

	 * The @GetMapping annotation ensures that HTTP GET requests are mapped to the annotated method. 
	 * @throws IOException 
	public String writeTSQs(@RequestParam(value = "tsqName", defaultValue = "ANNE") String tsqName,
			@RequestParam(value = "tsqContent", defaultValue = "Spring greetings from CICS!") String tsqContent) {

		String response = "";

		// Write to the TSQ
		try {
			response = writeTSQ(tsqName, tsqContent);
		} catch ( CicsConditionException | UnsupportedEncodingException e) {

			// Print the stack trace

			// Return useful information to the user when meeting errors
			return "Oops! Unexpected CICS condition exception: "  + e.getMessage() + ". Please check stderr for details.";
		return response;

	 * A method to write a record to a TSQ
	 * @param tsqName, the name of the TSQ to be written to
	 * @param record, the data to be written to the TSQ
	 * @return, the result of the write 
	 * @throws UnsupportedEncodingException 
	 * @throws CicsConditionException	   
	private String writeTSQ(String tsqName, String record) throws CicsConditionException, UnsupportedEncodingException{
		// Construct the TSQ object
		TSQ tsqQ = new TSQ();

		// the result of writing an item to the TSQ
		String result = "";

		// write the record to the TSQ
		result = "Record written to TSQ " + tsqName + ".";

		// return the result to the calling servlet
		return result;

It is a simple application that just writes data to TSQ using the TSQ class of JCICS. The query parameter of URI / writeTSQs receives tsqName and tsqContent, and writes the value specified by tsqContent to the TSQ specified by tsqName.

Check the context-root in ibm-web-ext.xml. This is also confirmation only.


<?xml version="1.0" encoding="UTF-8"?>

	<reload-interval value="3"/>
	<context-root uri="cics-java-liberty-springboot-jcics-ding" />
	<enable-directory-browsing value="false"/>
	<enable-file-serving value="true"/>
	<enable-reloading value="true"/>
	<enable-serving-servlets-by-class-name value="false" />


Open build.gradle and edit the dependency specifications to match your target CICS version. Since we are targeting CICS TS V5.6 here, modify it as follows.


compileOnly enforcedPlatform("")

The value to be specified will be judged from the following. Reference: IBM CICS TS BOM


Build with the following command.

c:\y\workspace\cicsts56\cics-java-liberty-springboot-jcics>gradlew.bat clean bootwar
Starting a Gradle Daemon (subsequent builds will be faster)

3 actionable tasks: 2 executed, 1 up-to-date

If successful, the following WAR will be created. build/libs/cics-java-liberty-springboot-jcics-0.1.0.war


The procedure in this sample is to deploy the WAR manually, so let's try it.

Transfer the above WAR file in binary mode to the drops directory you created earlier. The app should now be recognized automatically. (BUNDLE definition is not used for this method)

App operation check

From the browser, try making the following request to the host: port that the target Liberty is listening to. http://etp1:56441/cics-java-liberty-springboot-jcics-ding/writeTSQs?tsqName=SPGJCICS&tsqContent=ILOVECICS You will put the message ILOVECICS in a TSQ named SPGJCICS. Hopefully, the data will be written to TSQ, so check it with CEBR from the CICS terminal. image.png I was able to confirm that the data was input properly.

Sample operation check (2) / Deployment by Gradle

By the way, if the above procedure is done, the deployment will be manual and it is not smart, so let's add a CICS Bundle project so that Deploy can be executed with Gradle.

Attention! : If you tried manual deployment with the above procedure, the app will batting, so delete the war in the drops directory and restart JVMSERVER. </ font>

Gradle multi-project creation

Add a CICS Bundle project and create a parent project to combine with the WAR provided in the sample.

Parent project

First, create a directory called the parent project directory cics-springboot01. So run the gradle wrapper.

c:\y\workspace\cicsts56\cics-springboot01>gradle wrapper

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.

1 actionable task: 1 executed
c:\y\workspace\cicsts56\cics-springboot01>tree /a /f
List of folder paths:Volume Windows
Volume serial number is 1866-E2FC
|   gradlew
|   gradlew.bat
|   +---6.5
|   |   |
|   |   |
|   |   +---executionHistory
|   |   |       executionHistory.bin
|   |   |       executionHistory.lock
|   |   |
|   |   +---fileChanges
|   |   |       last-build.bin
|   |   |
|   |   +---fileHashes
|   |   |       fileHashes.bin
|   |   |       fileHashes.lock
|   |   |
|   |   \---vcsMetadata-1
|   +---buildOutputCleanup
|   |       buildOutputCleanup.lock
|   |
|   |       outputFiles.bin
|   |
|   +---checksums
|   |       checksums.lock
|   |
|   \---vcs-1

Create build.gradle and setting.gradle here as follows.


group ''
version '1.0.0'

setting.gradle = 'cics-springboot01'
include 'cics-java-liberty-springboot-jcics'
include 'cics-springboot-bundle04'

For child project (1) / WAR

It uses the one provided in the sample as is. Clone cics-java-liberty-springboot-jcics with git clone under the parent project directory as shown above. Then modify the compileOnly line in build.gradle to match your target CICS version.

For child project (2) / CICS Bundle

For this, referring to the previous article, we will create build.gradle for the bundle. Reference: Run CICS-Java application-(3) Build management by Gradle

Under the parent project directory, create a directory named cics-springboot-bundle04 and create a build.gradle like the one below. Match the directory name to the name specified in the parent setting.gradle.


plugins {
    id '' version '1.0.0'

group ''
version '1.0.0'

repositories {

cicsBundle {
    build {
        defaultJVMServer = 'DFHWLP' // (1)JVMSERVER name
    deploy {
        cicsplex = 'C73PLX'         // (2)The CICSplex name to which the target CICS region belongs
        region   = 'CT56B4A1'       // (3)Target CICS region name
        bunddef  = 'SPBBUNDL'       // (4)Bundle-defined resource name defined on the target CICS region
        csdgroup = 'TAGGRP'         // (5) (4)CSD group name to which the bundle definition of
        url      = 'http://etp1:56002'     // (6)WUI CMCI URL
        username = 'TAG'           // (7)With the user used when issuing the Deployment API by CMCI
        password = 'xxxxxxxx'      //password
        //caution: uncomment the line below to disable TLS/SSL checking for certificates
        //insecure = true

dependencies {
    cicsBundlePart project(path:':cics-java-liberty-springboot-jcics', configuration: 'archives')

The final structure will look like this.

c:\y\workspace\cicsts56\cics-springboot01>tree /a /f
List of folder paths:Volume Windows
Volume serial number is 1866-E2FC
|   build.gradle
|   gradlew
|   gradlew.bat
|   settings.gradle


|   |   .classpath
|   |   .gitignore
|   |   .project
|   |   build.gradle
|   |   build_original.gradle
|   |   gradlew
|   |   gradlew.bat
|   |   LICENSE
|   |   mvnw
|   |   mvnw.cmd
|   |   pom.xml
|   |
|   |   settings.gradle
|   |
|   +---.gradle
|   |   +---6.5
|   |   |   |
|   |   |   |
|   |   |   +---executionHistory
|   |   |   |       executionHistory.bin
|   |   |   |       executionHistory.lock
|   |   |   |
|   |   |   +---fileChanges
|   |   |   |       last-build.bin
|   |   |   |
|   |   |   +---fileContent
|   |   |   |       fileContent.lock
|   |   |   |
|   |   |   +---fileHashes
|   |   |   |       fileHashes.bin
|   |   |   |       fileHashes.lock
|   |   |   |
|   |   |   +---javaCompile
|   |   |   |       classAnalysis.bin
|   |   |   |       javaCompile.lock
|   |   |   |       taskHistory.bin
|   |   |   |
|   |   |   \---vcsMetadata-1
|   |   +---buildOutputCleanup
|   |   |       buildOutputCleanup.lock
|   |   |
|   |   |       outputFiles.bin
|   |   |
|   |   +---checksums
|   |   |       checksums.lock
|   |   |       md5-checksums.bin
|   |   |       sha1-checksums.bin
|   |   |
|   |   \---vcs-1
|   | 
|   |
|   +---.mvn
|   |   \---wrapper
|   |           maven-wrapper.jar
|   | 
|   | 
|   |
|   +---.settings
|   |       org.eclipse.buildship.core.prefs
|   |       org.eclipse.wst.common.component
|   |       org.eclipse.wst.common.project.facet.core.xml
|   |
|   +---gradle
|   |   \---wrapper
|   |           gradle-wrapper.jar
|   | 
|   |
|   \---src
|       \---main
|           +---java
|           |   \---com
|           |       \---ibm
|           |           \---cicsdev
|           |               \---springboot
|           |                   \---jcics
|           |                 
|           |                 
|           |                 
|           |                 
|           |                 
|           |                 
|           |
|           \---webapp
|               \---WEB-INF
|                       ibm-web-ext.xml
|                       web.xml
|       build.gradle

BUNDLE definition creation

Create a bundle definition according to the contents specified in build.gradle above.

OBJECT CHARACTERISTICS                                    CICS RELEASE = 0730 
 CEDA  View Bundle( SPBBUNDL )                                                
  Bundle         : SPBBUNDL                                                   
  Group          : TAGGRP                                                     
  DEScription    : CICS-SpringBoot-Sample                                     
  Status         : Enabled            Enabled | Disabled                      
  BUndledir      : /var/cicsts/cicsts56/bundles/cics-springboot-bundle04_1.0. 
  (Mixed Case)   : 0                                                          
  BAsescope      :                                                            
  (Mixed Case)   :                                                            
 DEFINITION SIGNATURE                                                         
  DEFinetime     : 07/07/20 17:03:45                                          
  CHANGETime     : 07/07/20 17:03:57                                          
                                                    SYSID=B4A1 APPLID=CT56B4A1

The CSD group is specified (5), the BUNDLE definition name is (4), and BUNDLEDIR is specified based on the directory name and version information value of the project.

  • Here, the installation operation is not performed yet.

Build / deploy execution

Build the Spring Boot WAR as follows:

c:\y\workspace\cicsts56\cics-springboot01>gradlew bootWar

2 actionable tasks: 2 executed

Then build and deploy the CICS Bundle.

c:\y\workspace\cicsts56\cics-springboot01>gradlew deployCICSBundle

> Task :cics-springboot-bundle04:buildCICSBundle
Adding Java-based bundle parts from 'cicsBundlePart' dependency configuration
Adding Java-based bundle part: 'C:\y\workspace\cicsts56\cics-springboot01\cics-java-liberty-springboot-jcics\build\libs\cics-java-liberty-springboot-jcics-0.1.0.war'
Adding non-Java-based bundle parts from 'src/main/resources'

> Task :cics-springboot-bundle04:deployCICSBundle
Task deployCICSBundle

4 actionable tasks: 3 executed, 1 up-to-date

It is OK if you can confirm that the bundle and bundle parts are ENABLED from CICS Explorer. image.png

I was able to deploy with Gradle!

By the way, if you look at Liberty's messages.log, you can see that the Spring Boot app is running.

[7/7/20 9:20:35:354 GMT] 000000d0               I CWWKE0703I: [] [CICSLibertyBundlepartControllerImpl] @Info : installBundlepart() - cics-java
-liberty-springboot-jcics-0.1.0, SPBBUNDL, 2, /var/cicsts/cicsts56/bundles/cics-springboot-bundle04_1.0.0/, 1.0.0, 206F2740000001E9, , , -1, -1, -1, CSD_API
[7/7/20 9:20:35:376 GMT] 000000d1               I CWWKE0703I: [] [CICSLibertyBundlepartControllerImpl] @Info : enableBundlepart() - 3549516473

[7/7/20 9:20:36:381 GMT] 00000055                      I CWWKZ0018I: Starting application cics-java-liberty-springboot-jcics-0.1.0.
[7/7/20 9:20:36:382 GMT] 00000055 I CWWKZ0136I: The cics-java-liberty-springboot-jcics-0.1.0 application is using the archive file at the /var/cicsts/cicsts56/C
T56B4A1/work/CT56B4A1/DFHWLP/wlp/usr/servers/defaultServer/installedApps/cics-java-liberty-springboot-jcics-0.1.0.war location.
[7/7/20 9:20:36:723 GMT] 00000055                 I SRVE0169I: Loading Web Module: cics-java-liberty-springboot-jcics.
[7/7/20 9:20:36:723 GMT] 00000055                                      I SRVE0250I: Web Module cics-java-liberty-springboot-jcics has been bound to default_host.
[7/7/20 9:20:36:723 GMT] 00000055                     A CWWKT0016I: Web application available (default_host): http://etp1:56441/cics-java-liberty-springboot-jcics-ding/
[7/7/20 9:20:36:725 GMT] 00000055                      A CWWKZ0003I: The application cics-java-liberty-springboot-jcics-0.1.0 updated in 0.344 seconds.
[7/7/20 9:20:36:733 GMT] 0000004d          I SRVE9103I: A configuration file for a web server plugin was automatically generated for this server at /var/cicsts/cicsts56/
[7/7/20 9:20:36:800 GMT] 0000004b                            I SESN0176I: A new session context will be created for application key default_host/cics-java-liberty-springboot-jcics-ding
[7/7/20 9:20:36:801 GMT] 0000004b                                              I SESN0172I: The session manager is using the Java default SecureRandom implementation for session ID generation.
[7/7/20 9:20:37:064 GMT] 0000004b                               I SRVE0292I: Servlet Message - [cics-java-liberty-springboot-jcics-0.1.0]:.2 Spring WebApplicationInitializers detected on cla
[7/7/20 9:20:37:973 GMT] 0000004b SystemOut                                                    O   .   ____          _            __ _ _
[7/7/20 9:20:37:973 GMT] 0000004b SystemOut                                                    O  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
[7/7/20 9:20:37:973 GMT] 0000004b SystemOut                                                    O ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
[7/7/20 9:20:37:973 GMT] 0000004b SystemOut                                                    O  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
[7/7/20 9:20:37:973 GMT] 0000004b SystemOut                                                    O   '  |____| .__|_| |_|_| |_\__, | / / / /
[7/7/20 9:20:37:973 GMT] 0000004b SystemOut                                                    O  =========|_|==============|___/=/_/_/_/
[7/7/20 9:20:37:974 GMT] 0000004b SystemOut                                                    O  :: Spring Boot ::        (v2.3.0.RELEASE)
[7/7/20 9:20:38:131 GMT] 0000004b SystemOut                                                    O 2020-07-07 09:20:38.128  INFO 83952403 --- [RVICE_Thread-28] c.i.c.s.jcics.ServletInitializer         : Starting ServletInit
ializer on with PID 83952403 (/var/cicsts/cicsts56/CT56B4A1/work/CT56B4A1/DFHWLP/wlp/usr/servers/defaultServer/installedApps/cics-java-liberty-springboot-jcics-0.1.0.war started by STCUSR in /ETP1/var/cic
[7/7/20 9:20:38:133 GMT] 0000004b SystemOut                                                    O 2020-07-07 09:20:38.133  INFO 83952403 --- [RVICE_Thread-28] c.i.c.s.jcics.ServletInitializer         : No active profile se
t, falling back to default profiles: default
[7/7/20 9:20:38:446 GMT] 00000053               A CWWKG0016I: Starting server configuration update.
[7/7/20 9:20:38:448 GMT] 00000053               A CWWKG0028A: Processing included configuration resource: /var/cicsts/cicsts56/CT56B4A1/work/CT56B4A1/DFHWLP/wlp/usr/servers/d
[7/7/20 9:20:38:450 GMT] 00000053               A CWWKG0018I: The server configuration was not updated. No functional changes were detected.
[7/7/20 9:20:39:214 GMT] 0000004b                               I SRVE0292I: Servlet Message - [cics-java-liberty-springboot-jcics-0.1.0]:.Initializing Spring embedded WebApplicationContext
[7/7/20 9:20:39:214 GMT] 0000004b SystemOut                                                    O 2020-07-07 09:20:39.214  INFO 83952403 --- [RVICE_Thread-28] o.s.web.context.ContextLoader            : Root WebApplicationC
ontext: initialization completed in 1011 ms
[7/7/20 9:20:39:608 GMT] 0000004b SystemOut                                                    O 2020-07-07 09:20:39.608  INFO 83952403 --- [RVICE_Thread-28] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing Executo
rService 'applicationTaskExecutor'
[7/7/20 9:20:39:847 GMT] 0000004b SystemOut                                                    O 2020-07-07 09:20:39.846  INFO 83952403 --- [RVICE_Thread-28] c.i.c.s.jcics.ServletInitializer         : Started ServletIniti
alizer in 2.638 seconds (JVM running for 3347.897)
[7/7/20 9:25:53:853 GMT] 00000045                               I SRVE0292I: Servlet Message - [cics-java-liberty-springboot-jcics-0.1.0]:.Initializing Spring DispatcherServlet 'dispatcherSe
[7/7/20 9:25:53:853 GMT] 00000045 SystemOut                                                    O 2020-07-07 09:25:53.853  INFO 83952403 --- [HP.TASK205.CJSA] o.s.web.servlet.DispatcherServlet        : Initializing Servlet
[7/7/20 9:25:53:863 GMT] 00000045 SystemOut                                                    O 2020-07-07 09:25:53.863  INFO 83952403 --- [HP.TASK205.CJSA] o.s.web.servlet.DispatcherServlet        : Completed initializa
tion in 10 ms
[7/7/20 9:25:53:863 GMT] 00000045                              I SRVE0242I: [cics-java-liberty-springboot-jcics-0.1.0] [/cics-java-liberty-springboot-jcics-ding] [dispatcherServlet]: Initia
lization successful.

App operation check

As in the previous example, let's run the app that writes to TSQ from the browser. This time, the character string to be written is "I LOVE CCDS2". image.png The result was returned normally. When I checked with CEBR from the CICS terminal, I was able to confirm that the data was written properly! image.png

Sample customization

With CICS TS V5.5 + APAR PH14856 or V5.6 base, you can treat your Spring Boot app like a traditional CICS program, so you can call the Spring Boot program with EXEC CICS LINK or with EXEC CICS START. You will be able to call it. Reference: Linking to a Java EE or Spring Boot application from a CICS program

Here, we will try a scenario that calls a Spring Boot app with EXEC CICS LINK from a language such as COBOL. When calling the Spring Boot app with EXEC CICS LINK, we will use Channel & Container for data transfer, but for the sake of simplicity, we will simply add and implement only the program call part without performing data transfer. ..

Change server.xml

When configuring to call a program on Liberty, it is necessary to add cicsts: link-1.0 as a feature of Liberty which is the runtime. Add a feature as shown below and restart the JVM Server (Disabled => Enabled).



Import sample project into Eclipse

Import the sample project provided on GitHub mentioned above into Eclipse. Here, we use Eclipse provided as CICS Explorer.

Install Buildship Gradle Integration from the Eclipse Marketplace. image.png image.png

In the Java Perspective's Package Explorer view, right-click --Import--Projects from Folder or Archive, and select the cloned project directory to import. image.png

After importing, a red x is attached and an error is displayed. image.png

Right click on the project --Gradle --Refresh Gradle Project image.png

The error has disappeared! image.png

Add logic

First, add a dependency to build.gradle. Add the following to dependencies.


    // for @CICSProgram annotation
    compileOnly ("")
    annotationProcessor ("")

Run the Refresh Gradle Project.

Create the following files in the same package as


import org.springframework.stereotype.Component;

public class WriteTSQLinked {
    public void writeTSQlinked()
		String tsqName = "SPGJCICS";
		String record  = "ILOVECICS3";

		// Write to the TSQ
		try {
			// Construct the TSQ object
			TSQ tsqQ = new TSQ();

			// write the record to the TSQ
		} catch ( CicsConditionException  e) {
			// Print the stack trace

The @CICSProgram annotation makes the method immediately after it recognized as a CICS program named" WRTTSQ ". To recognize it as a CICS program, the method must be defined with a public specification and no arguments. This time, I added the logic to write the value ILOVECICS3 to TSQ called SPGJCICS by embedding without any argument.

Build / deploy

C:\y\workspace\cicsts56\cics-springboot02>gradlew bootWar

2 actionable tasks: 2 executed
C:\y\workspace\cicsts56\cics-springboot02>gradlew deployCICSBundle

> Task :cics-springboot-bundle04:buildCICSBundle
Adding Java-based bundle parts from 'cicsBundlePart' dependency configuration
Adding Java-based bundle part: 'C:\y\workspace\cicsts56\cics-springboot02\cics-java-liberty-springboot-jcics\build\libs\cics-java-liberty-springboot-jcics-0.1.0.war'
Adding non-Java-based bundle parts from 'src/main/resources'

> Task :cics-springboot-bundle04:deployCICSBundle
Task deployCICSBundle

4 actionable tasks: 3 executed, 1 up-to-date

When complete, the bundle will be installed and the WAR will be installed as a bundle part. Furthermore, the method specified by @CICSProgram included in it is recognized as a CICS program, so the CICS program" WRTTSQ "is installed.


The details of the installed program definition are like this (check with CICS Explorer) image.png

A message like this appears in the JOBLOG of the target region.

DFHRL0107 I 07/08/2020 15:40:30 CT56B4A1 CICSUSER The CICS resource lifecycle manager has started to create the BUNDLE resource    
DFHRL0125 I 07/08/2020 15:40:30 CT56B4A1 CICSUSER BUNDLE resource SPBBUNDL is being created with BUNDLEID cics-springboot-bundle04 
           and version 1.0.0.                                                                                                      
DFHSJ1105 07/08/2020 15:40:30 CT56B4A1 WAR bundle cics-java-liberty-springboot-jcics-0.1.0 version 1.0.0 from BUNDLE SPBBUNDL has  
           been installed as Disabled.                                                                                             
DFHRL0108 I 07/08/2020 15:40:30 CT56B4A1 CONL The CICS resource lifecycle manager is in the process of creating the BUNDLE resource
           SPBBUNDL and the BUNDLE is in the enabling state.                                                                       
DFHRD0128 I 07/08/2020 15:40:30 CT56B4A1  CICSUSER CONL INSTALL BUNDLE(SPBBUNDL)                                                   
???? ??? CONL CICSUSER 07/08/20 15:40:30 INSTALL BUNDLE(SPBBUNDL) GROUP(TAGGRP)                                                    
DFHFC0961 07/08/2020 15:40:30 CT56B4A1 Calculation of LSR pool 1 parameters incomplete. Filename DFHDBFK has no DSNAME.            
DFHPG0101 07/08/2020 15:40:34 CT56B4A1  CICSUSER CJSP Resource definition for WRTTSQ has been added.                               
DFHSJ1204 07/08/2020 15:40:34 CT56B4A1 A linkable service has been registered for program WRTTSQ in JVMSERVER DFHWLP with classname
 , method writeTSQlinked.                                                 
DFHSJ1107 07/08/2020 15:40:34 CT56B4A1 WAR bundle with symbolic name cics-java-liberty-springboot-jcics-0.1.0 version 1.0.0 has bee
DFHRL0132 I 07/08/2020 15:40:34 CT56B4A1 CJSL All defined resources for BUNDLE SPBBUNDL are now in the enabled state.              

App operation check

Let's simply issue `CECI LINK PROGRAM (WRTTSQ)'from the CICS terminal. image.png

Let's check the contents of TSQ "SPG JCICS" with CEBR. image.png

The expected message is written! Now you can see the flow of calling the Spring Boot app using EXEC CICS LINK!

Recommended Posts

CICS-Run Java application-(4) Spring Boot application
Spring Boot 2.3 Application Availability
[Spring Boot] Web application creation
[Java] Thymeleaf Basic (Spring Boot)
[Java] [Spring] Spring Boot 1.4-> 1.2 Downgrade Note
Spring Java
Spring Boot + Java + GitHub authentication login
Spring Boot application development in Eclipse
Spring Boot application code review points
Elastic Beanstalk (Java) + Spring Boot + https
Inquiry application creation with Spring Boot
Java --Jersey Framework vs Spring Boot
Implement Spring Boot application in Gradle
[Java] LINE integration with Spring Boot
[Java] [Spring] Spring Boot Dependency injection mysterious hamarineta
Java 9+ application status
Challenge Spring Boot
Create Java Spring Boot project in IntelliJ
Start web application development with Spring Boot
Launch Nginx + Spring Boot application with docker-compose
Spring Boot + Docker Java development environment construction
Spring Boot Form
Spring Boot Memorandum
gae + spring boot
[Java] Spring DI ③
Run WEB application with Spring Boot + Thymeleaf
Java beginner tried to make a simple web application using Spring Boot
Introduction to Java development environment & Spring Boot application created with VS Code
Configure Spring Boot application with maven multi module
Create a Spring Boot application using IntelliJ IDEA
[Java / Spring Boot] Spring security ④ --Implementation of login process
Java tips-Create a Spring Boot project in Gradle
[Java / Spring Boot] Spring security ⑤ --Implementation of logout processing
[Java] Hello World with Java 14 x Spring Boot 2.3 x JUnit 5 ~
CICS-Run Java application-(1) Run a simple sample app
[Java] Article to add validation with Spring Boot 2.3.1.
Deploy a Spring Boot application on Elastic Beanstalk
LINE Bot x Java (Spring Boot) construction procedure
SPRING BOOT learning record 01
Spring Boot + Heroku Postgres
Spring boot memo writing (1)
First Spring Boot (DI)
SPRING BOOT learning record 02
Spring Boot2 cheat sheet
Spring Boot exception handling
Spring boot development-development environment-
Spring Boot learning procedure
Learning Spring Boot [Beginning]
Spring boot memo writing (2)
Spring Boot 2.2 Document Summary
[Spring Boot] DataSourceProperties $ DataSourceBeanCreationException
Spring boot tutorials Topics
Download with Spring Boot
Create a portfolio app using Java and Spring Boot
Spring Boot application built-in Tomcat, Apache and WebSocket integration
[Java] [Spring Boot] Specify runtime profile --Spring Boot starting with NetBeans
Try using OpenID Connect with Keycloak (Spring Boot application)
Content-Type: application / json doesn't have charset = UTF-8 from Spring Boot 2.2
Java (WebSphere Application Server) memo [1]
[Spring Boot] Environment construction (macOS)
[Java / Kotlin] Escape (sanitize) HTML5 support with unbescape [Spring Boot]