Skip to content

Commit 752a6cf

Browse files
Fix Eclipse Project structure.
Add .settings. Correct Web-app namespace. Fix WLPH description length. Add buildship prefs. Configure classpaths. Add Explicit encoding.
1 parent 9007678 commit 752a6cf

File tree

15 files changed

+117
-43
lines changed

15 files changed

+117
-43
lines changed

.project

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
33
<name>cics-java-liberty-link</name>
4+
<comment></comment>
45
<projects>
56
</projects>
67
<buildSpec>
@@ -9,14 +10,28 @@
910
<arguments>
1011
</arguments>
1112
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.validation.validationbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
1223
<buildCommand>
1324
<name>org.eclipse.m2e.core.maven2Builder</name>
1425
<arguments>
1526
</arguments>
1627
</buildCommand>
1728
</buildSpec>
1829
<natures>
30+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
1933
<nature>org.eclipse.m2e.core.maven2Nature</nature>
34+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
2035
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
2136
</natures>
2237
</projectDescription>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5+
connection.project.dir=cics-java-liberty-link-app
6+
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=false
12+
show.console.view=false
13+
show.executions.view=false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.8
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
12+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
13+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
14+
org.eclipse.jdt.core.compiler.release=disabled
15+
org.eclipse.jdt.core.compiler.source=1.8

README.md

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
# cics-java-liberty-link
1+
# Sample: cics-java-liberty-link
22
[![Build](https://github.com/cicsdev/cics-java-liberty-link/actions/workflows/java.yaml/badge.svg)](https://github.com/cicsdev/cics-java-liberty-link/actions/workflows/java.yaml)
33

4-
Sample CICS Java application showing use of the `com.ibm.cics.server.invocation.CICSProgram` annotation to link to an enterprise Java program running in a Liberty JVM server.
4+
A sample CICS Java application showing use of the `com.ibm.cics.server.invocation.CICSProgram` annotation to link to an Enterprise Java program running in a Liberty JVM server.
55

66
## Contents
7-
This is a set of sample Eclipse projects for Link to Liberty, demonstrating how you can annotate a POJO packaged in a WAR in a Liberty JVM server, to allow it be called from a CICS program.
7+
A set of sample components that demonstrate how to annotate a POJO packaged in a WAR (Web application), deploy it to a Liberty JVM server, and then LINK to (or call) that POJO from a CICS program or CICS transaction.
88

9-
- [cics-java-liberty-link-app](./cics-java-liberty-link-app) - Web project
10-
- [cics-java-liberty-link-bundle](./cics-java-liberty-link-bundle) - CICS bundle project with Web app and WLPH transaction as bundle parts.
11-
- [etc/config/liberty/server.xml](./etc/config/liberty/server.xml) - Template `server.xml` file.
12-
- [etc/eclipse_projects/com.ibm.cics.server.examples.wlp.link.bundle](./etc/eclipse_projects/com.ibm.cics.server.examples.wlp.link.bundle) - CICS bundle project (CICS Explorer)
9+
- [cics-java-liberty-link](./cics-java-liberty-link) - Top-level project.
10+
- [cics-java-liberty-link-app](./cics-java-liberty-link-app) - Web project.
11+
- [cics-java-liberty-link-bundle](./cics-java-liberty-link-bundle) - CICS bundle plug-in based project, contains Web application and WLPH transaction bundle-parts. Use with Gradle and Maven builds.
12+
- [etc/eclipse_projects/com.ibm.cics.server.examples.wlp.link.bundle](./etc/eclipse_projects/com.ibm.cics.server.examples.wlp.link.bundle) - CICS Explorer based CICS bundle project, contains Web application and WLPH transaction bundle-parts. Use with CICS Explorer 'Export to zFS' deployment capability.
13+
- [etc/config/liberty/server.xml](./etc/config/liberty/server.xml) - A template `server.xml` demonstrating the minimum configuration required to run the sample.
1314

1415
## Prerequisites
15-
* CICS TS V5.5 or later
16-
* Java SE 1.8 or later on the workstation
17-
* Eclipse with the IBM CICS SDK for Java EE, Jakarta EE and Liberty, or any IDE that supports usage of the Maven Central artifact [com.ibm.cics:com.ibm.cics.server.](https://search.maven.org/artifact/com.ibm.cics/com.ibm.cics.server)
18-
* Either Gradle or Apache Maven on the workstation
16+
- CICS TS V5.5 or later
17+
- Java SE 1.8 or later on the workstation
18+
- One of the following:
19+
- Eclipse with the IBM CICS SDK for Java EE, Jakarta EE and Liberty
20+
- An IDE of your choice that supports Gradle or Maven
21+
- A command line version of Gradle or Apache Maven on the workstation
1922

2023
## Downloading
2124

@@ -27,7 +30,7 @@ This is a set of sample Eclipse projects for Link to Liberty, demonstrating how
2730
2831
### Check dependencies
2932

30-
Before building this sample, you should verify that the correct CICS TS bill of materials (BOM) is specified for your target release of CICS. The BOM specifies a consistent set of artifacts, and adds information about their scope. In the example below the version specified is compatible with CICS TS V5.5 with JCICS APAR PH25409, or newer. That is, the Java byte codes built by compiling against this version of JCICS will be compatible with later CICS TS versions and subsequent JCICS APARs.
33+
If you are building this sample with Gradle or Maven you should verify that the correct CICS TS bill of materials (BOM) is specified for your target release of CICS. The BOM specifies a consistent set of artifacts, and adds information about their scope. In the example below the version specified is compatible with CICS TS V5.5 with JCICS APAR PH25409, or newer. That is, the Java byte codes built by compiling against this version of JCICS will be compatible with later CICS TS versions and subsequent JCICS APARs.
3134
You can browse the published versions of the CICS BOM at [Maven Central.](https://mvnrepository.com/artifact/com.ibm.cics/com.ibm.cics.ts.bom)
3235

3336
Gradle (build.gradle):
@@ -52,25 +55,31 @@ Maven (POM.xml):
5255

5356
## Building
5457

55-
You can build the sample using an IDE of your choice, or you can build it from the command line. For both approaches, using Gradle or Maven is the recommended way to get a consistent version of build tooling.
58+
You can build the sample in a variety of ways:
59+
- Using the implicit compile/build of the Eclipse based CICS Explorer SDK
60+
- Using the built-in Gradle or Maven support of your IDE (For example: *buildship* or *m2e* in Eclipse which integrate with the "Run As..." menu.)
61+
- or you can build it from the command line with Gradle or Maven
5662

57-
For an IDE, taking Eclipse as an example, the plug-ins for Gradle *buildship* and Maven *m2e* will integrate with the "Run As..." capability, allowing you to specify a specific version of your chosen build tool.
5863

59-
> [!NOTE]
60-
> If you import the project to your IDE, you might experience local project compile errors. To resolve these errors you should run a tooling refresh on that project. For example, in Eclipse: right-click on "Project", select "Gradle -> Refresh Gradle Project", **or** right-click on "Project", select "Maven -> Update Project...".
64+
> [!IMPORTANT]
65+
> When you initially import the project to your IDE, you might experience local project compile errors. Resolving these errors depends on how you wish to build and deploying the sample. If you are building and deploying through CICS Explorer SDK and 'Export to zFS' you should edit the link-app's Project properties, select 'Java Build Path', on the Libraries tab select 'Classpath', click 'Add Library', select 'CICS with Enterprise Java and Liberty' Library, and choose the appropriate CICS and Enterprise Java versions.
66+
If you are building and deploying with Gradle or Maven then you don't necessarily need to fix the local errors, but to do so, you can run a tooling refresh on the link-app project. For example, in Eclipse: right-click on "Project", select "Gradle -> Refresh Gradle Project", **or** right-click on "Project", select "Maven -> Update Project...".
6167
6268
> [!TIP]
6369
> In Eclipse, Gradle (buildship) is able to fully refresh and resolve the local classpath even if the project was previously updated by Maven. However, Maven (m2e) does not currently reciprocate that capability. If you previously refreshed the project with Gradle, you'll need to manually remove the 'Project Dependencies' entry on the Java build-path of your Project Properties to avoid duplication errors when performing a Maven Project Update.
6470
65-
### Eclipse
71+
### Building with Eclipse
6672

67-
Import the projects into CICS Explorer using File &rarr; Import &rarr; General &rarr; Existing projects into workspace.
68-
> [!NOTE]
69-
> If using the egit client, you can just clone the repo and tick the button to import all projects.
73+
If you are using the Egit client to clone the repo, remember to tick the button to import all projects. Otherwise, you should manually Import the projects into CICS Explorer using File &rarr; Import &rarr; General &rarr; Existing projects into workspace, then follow the error resolution advice above.
7074

7175
### Building with Gradle
7276

73-
A WAR file is created inside the `cics-java-liberty-link-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-liberty-link-bundle/build/distribution` directory.
77+
For a complete build you should run the settings.gradle file in the top-level 'cics-java-liberty-link' directory which is designed to invoke the individual build.gradle files for each project.
78+
79+
If successful, a WAR file is created inside the `cics-java-liberty-link-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-liberty-link-bundle/build/distribution` directory.
80+
81+
[!NOTE]
82+
In Eclipse, the output 'build' directory is often hidden by default. From the Package Explorer pane, select the three dot menu, choose filters and un-check the Gradle build folder to view its contents.
7483

7584
The JVM server the CICS bundle is targeted at is controlled through the `cics.jvmserver` property, defined in the [`cics-java-liberty-link-bundle/build.gradle`](cics-java-liberty-link-bundle/build.gradle) file, or alternatively can be set on the command line:
7685

@@ -93,7 +102,7 @@ gradle clean build -Pcics.jvmserver=MYJVM
93102

94103
### Building with Apache Maven
95104

96-
A WAR file is created inside the `cics-java-liberty-link-app/target` directory and a CICS bundle ZIP file inside the `cics-java-liberty-link-bundle/target` directory.
105+
For a complete build you should run the pom.xml file in the top-level 'cics-java-liberty-link' directory. A WAR file is created inside the `cics-java-liberty-link-app/target` directory and a CICS bundle ZIP file inside the `cics-java-liberty-link-bundle/target` directory.
97106

98107
If building a CICS bundle ZIP the CICS JVM server name for the WAR bundle part should be modified in the
99108
`cics.jvmserver` property, defined in [`cics-java-liberty-link-bundle/pom.xml`](cics-java-liberty-link-bundle/pom.xml) file under the `defaultjvmserver` configuration property, or alternatively can be set on the command line.
@@ -123,9 +132,9 @@ Ensure you have the following features defined in your Liberty server.xml:
123132
A template server.xml is provided [here](./etc/config/liberty/server.xml).
124133

125134
### Deploying CICS Bundles with CICS Explorer
126-
1. Change the name of the JVMSERVER in the .warbundle file of the CICS bundle project from DFHWLP to the name of the JVMSERVER resource defined in CICS.
135+
1. Optionally, change the name of the JVMSERVER in the .warbundle file of the CICS bundle project from DFHWLP to the name of your JVMSERVER resource defined in CICS.
127136
2. Export the bundle project to zFS by selecting 'Export Bundle project to z/OS Unix File System' from the context menu.
128-
3. Create a bundle definition, setting the bundle directory attribute to the zFS location you just exported to, and install it.
137+
3. In CICS, create a bundle definition, setting the bundle directory attribute to the zFS location you just exported to, and install it.
129138
4. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command.
130139

131140
### Deploying CICS Bundles from Gradle or Maven
@@ -134,15 +143,17 @@ A template server.xml is provided [here](./etc/config/liberty/server.xml).
134143
3. Create a CICS BUNDLE resource definition, setting the bundle directory attribute to the zFS location you just extracted to, and install it into the CICS region.
135144
4. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command.
136145

137-
### Deploying with Liberty configuration
146+
### Deploying directly with Liberty's application configuration
138147
1. Manually upload the WAR file from the _cics-java-liberty-link-app/target_ or _cics-java-liberty-link-app/build/libs_ directory to zFS.
139148
2. Add an `<application>` element to the Liberty server.xml to define the web application.
140149
3. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command.
141150

142151

143152
## Running
144153

145-
You can use the CECI transaction to invoke the sample program:
154+
If you deployed the sample through CICS Explorer (Export to zFS), or through the CICS bundle plug-in as a ZIP and manually FTP'd the resource to zFS, the sample can be run using the `WLPH` transaction that is provided as a bundlepart within the CICS bundle definition.
155+
156+
Alternatively, you can define your own CICS transaction to invoke the program 'HELLOWLP', or you can use the CECI transaction to invoke the sample program:
146157

147158
```text
148159
CECI LINK PROGRAM(HELLOWLP)
@@ -159,7 +170,7 @@ CECI LINK PROG(HELLOWLP) CHANNEL(CHAN)
159170

160171
(ensure both commands are entered in the same CECI session).
161172

162-
Alternatively, the enterprise Java program can be run using the provided `WLPH` transaction.
173+
163174

164175
## Find out more
165176
For more information about invoking Java EE applications in a Liberty JVM server from CICS programs, see [Linking to Java applications in a Liberty JVM server by using the @CICSProgram annotation](https://www.ibm.com/docs/en/cics-ts/latest?topic=djariljs-linking-java-applications-in-liberty-jvm-server-by-using-cicsprogram-annotation).

bin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 9007678f1c74983e3a314353d20ef12595223e58

cics-java-liberty-link-app/.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
33
<name>cics-java-liberty-link-app</name>
4+
<comment></comment>
45
<projects>
56
</projects>
67
<buildSpec>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
34
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
46
org.eclipse.jdt.core.compiler.compliance=1.8
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
510
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
612
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
13+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
714
org.eclipse.jdt.core.compiler.processAnnotations=enabled
15+
org.eclipse.jdt.core.compiler.release=disabled
816
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
2-
2+
3+
34

45

56
<wb-module deploy-name="cics-java-liberty-link-app">
6-
<wb-resource deploy-path="/WEB-INF/classes" source-path="/.apt_generated"/>
7+
78
<wb-resource deploy-path="/WEB-INF/classes" source-path="/.apt_generated_tests"/>
9+
810
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
11+
912
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
10-
11-
13+
<wb-resource deploy-path="/WEB-INF/classes" source-path="/.apt_generated"/>
14+
1215

13-
<property name="java-output-path" value="/cics-java-liberty-link-app/build/classes"/>
14-
1516
<property name="context-root" value="cics-java-liberty-link-app"/>
16-
17+
<property name="java-output-path" value="/cics-java-liberty-link-app/bin/default"/>
18+
19+
1720

1821

1922
</wb-module>
20-
23+
24+
2125

2226

2327
</project-modules>
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<faceted-project>
3-
<fixed facet="jst.web"/>
4-
<fixed facet="java"/>
5-
<fixed facet="wst.jsdt.web"/>
6-
<installed facet="jst.web" version="3.0"/>
7-
<installed facet="wst.jsdt.web" version="1.0"/>
3+
<installed facet="jst.web" version="5.0"/>
84
<installed facet="java" version="1.8"/>
95
</faceted-project>

0 commit comments

Comments
 (0)