You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,73 +14,167 @@ Demonstrates how OSGi CICS Java programs link to other CICS programs sending a C
14
14
*[`ChannelLinkCICSProgram.java`](cics-java-osgi-link-app/src/main/java/com/ibm/cicsdev/java/osgi/link/cicsprogram/ChannelLinkCICSProgram.java) - OSGi `@CICSProgram` defined program linked to with a channel
15
15
16
16
17
+
## Downloading
18
+
19
+
- Clone the repository using your IDEs support, such as the Eclipse Git plugin
20
+
-**or**, download the sample as a [ZIP](https://github.com/cicsdev/cics-java-osgi-link/archive/cicsts/v5.5.zip) and unzip onto the workstation
21
+
22
+
> [!TIP]
23
+
> Eclipse Git provides an 'Import existing Projects' check-box when cloning a repository.
The sample can be built using Gradle or Maven to produce an OSGi bundle JAR file and optionally a CICS Bundle archive.
34
+
The sample includes an Eclipse project configuration, a Gradle build, a Maven POM, and Gradle/Maven Wrappers offering a wide range of build options with the tooling and IDE of your choice.
35
+
36
+
Choose from the following approach:
37
+
* Use the built-in Eclipse and CICS Explorer SDK capability
38
+
* Use Eclipse with Buildship (Gradle), or m2e (Maven) to drive Gradle, or Maven.
39
+
* Use the command line, or IDE terminal, to drive Gradle or Apache Maven (if installed on your workstation)
40
+
* Use the command line, or IDE terminal, or IDE support for Wrappers, to drive the supplied Gradle or Apache Maven Wrappers (with no requirement for Gradle, Maven, Eclipse, or CICS Explorer SDK to be installed)
41
+
42
+
43
+
** Note: ** If you import the project to your IDE, you might experience local project compile errors. To resolve these errors follow the relevant build section below.
44
+
45
+
46
+
### Option 1 - Building with Eclipse
25
47
26
-
### Building with Gradle
48
+
The sample comes pre-configured for use with a standard JDK 1.8 and the CICS TS V5.5 Java EE 6/7 Target Platform. When you initially import the project to your IDE, if your IDE is not configured for a JDK 1.8, or does not have CICS Explorer SDK installed with the correct 'target platform' set, you might experience local project compile errors.
27
49
28
-
A JAR file will be created in `cics-java-osgi-link-app/build/libs/cics-java-osgi-link-app-1.0.0.jar` and a CICS bundle ZIP file in `cics-java-osgi-link-app/build/distributions/cics-java-osgi-link-bundle-1.0.0.zip`.
50
+
To resolve issues:
51
+
* ensure you have the CICS Explorer SDK plug-in installed
52
+
* configure the Project's build-path, and Application Project settings to use your preferred JDK and Java compiler settings
53
+
* set the CICS TS Target Platform to your intended CICS target (Hint: Window | Preferences | Plug-in Development | Target Platform | Add | Template | Other...)
29
54
30
-
If using the CICS bundle ZIP, the CICS JVM server name for the OSGi bundle part should be modified in the `cics.jvmserver` property in the gradle build properties file to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line.
55
+
56
+
### Option 2 - Building with Gradle
57
+
58
+
You don't necessarily need to fix the local errors, but to do so, you can run a tooling refresh on the cics-java-osgi-link-app project. For example, in Eclipse: right-click on "Project", select "Gradle | Refresh Gradle Project".
59
+
60
+
The CICS JVM server name should be modified in the `cics.jvmserver` property in the gradle build [cics-java-osgi-link-bundle/build.gradle](cics-java-osgi-link-bundle/build.gradle) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line (see below).
61
+
62
+
If you have the Gradle buildship plug-in available, use the right-click **Run As...** menu on the cics-java-osgi-link project to configure and run the `clean` and `build` tasks. Otherwise choose from the command-line approaches.
31
63
32
64
**Gradle Wrapper (Linux/Mac):**
33
65
```shell
34
66
./gradlew clean build
35
67
```
68
+
36
69
**Gradle Wrapper (Windows):**
37
70
```shell
38
71
gradle.bat clean build
39
72
```
73
+
40
74
**Gradle (command-line):**
41
75
```shell
42
76
gradle clean build
43
77
```
78
+
44
79
**Gradle (command-line & setting jvmserver):**
45
80
```shell
46
81
gradle clean build -Pcics.jvmserver=MYJVM
47
82
```
48
83
49
-
### Building with Apache Maven
50
-
A JAR file will be created in `cics-java-osgi-link-app/target/cics-java-osgi-link-app-1.0.0.jar`. The CICS bundle ZIP file will be stored in `cics-java-osgi-link-bundle/target/cics-java-osgi-link-bundle-1.0.0.zip`.
84
+
A JAR file is created inside the `cics-java-osgi-link-app/build/libs/` directory and a CICS bundle ZIP file inside the `cics-java-osgi-link-bundle/build/distributions` directory.
85
+
86
+
87
+
### Option 3 - Building with Apache Maven
51
88
52
-
If building a CICS bundle ZIP the CICS bundle plugin is driven using the maven verify phase. The CICS JVM server name for the OSGi bundle part should be modified in the `cics.jvmserver` property in the pom.xml to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line.
89
+
You don't necessarily need to fix the local errors, but to do so, you can run a tooling refresh on the cics-java-osgi-link-app project. For example, in Eclipse: right-click on "Project", select "Maven -> Update Project...".
90
+
91
+
> [!TIP]
92
+
> 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 or with the CICS Explorer SDK Java Libraries, 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.
93
+
94
+
The CICS JVM server name should be modified in the `<cics.jvmserver>` property in the [`pom.xml`](pom.xml) to match the required CICS JVMSERVER resource name, or alternatively can be set on the command line (see below).
95
+
96
+
If you have the Maven m2e plug-in available, use the right-click **Run As...** menu on the cics-java-osgi-link project to configure and run the `clean` and `verify` tasks. Otherwise choose from the command-line approaches.
53
97
54
98
**Maven Wrapper (Linux/Mac):**
55
99
```shell
56
100
./mvnw clean verify
57
101
```
102
+
58
103
**Maven Wrapper (Windows):**
59
104
```shell
60
105
mvnw.cmd clean verify
61
106
```
107
+
62
108
**Maven (command-line):**
63
109
```shell
64
110
mvn clean verify
65
111
```
112
+
66
113
**Maven (command-line & setting jvmserver):**
67
114
```shell
68
115
mvn clean verify -Dcics.jvmserver=MYJVM
69
116
```
70
117
118
+
A JAR file is created inside the `cics-java-osgi-link-app/target` directory and a CICS bundle ZIP file inside the `cics-java-osgi-link-bundle/target` directory.
119
+
120
+
---
121
+
71
122
## Deploying to CICS
123
+
1. Configure an OSGi JVMSERVER.
124
+
125
+
2. CICS resource definitions for the bundle, programs, transactions and a JVM server are supplied in a group CDEVSAMP as a DFHCSDUP sample input stream supplied in [`DFHCSD.txt`](etc/DFHCSD.txt). Alternatively they can be installed using the bundle parts supplied with the cics-java-osgi-link-bundle project.
126
+
Note that the resource definitions for the CICS programs `CDEVMCLC` and `CDEVMCTC` for the Channel sample are not supplied as they will be auto-installed by the processing of @CICSProgram annotation.
127
+
128
+
129
+
### Option 1 - Deploying using CICS Explorer SDK and the provided CICS bundle project
130
+
1. Deploy the CICS bundle project 'com.ibm.cics.server.examples.osgi.link.bundle' from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. This CICS bundle includes the osgi bundlepart, the MCLC & MCLM transactions and the CDEVMCLM & CDEVMCTM programs to run the sample.
131
+
132
+
133
+
### Option 2 - Deploying using CICS Explorer SDK with own CICS bundle project
134
+
1. Copy and paste the built JAR from your *projects/cics-java-osgi-link-app/target* or *projects/cics-java-osgi-link-app/build/libs* directory into a new Eclipse CICS bundle project.
135
+
2. Create a new OSGi bundlepart that references the JAR (OSGi bundle) file.
136
+
3. Optionally customise the CICS bundle contents, perhaps adding a TRANDEF of your choice
137
+
4. Right click using the ** Export Bundle Project to z/OS UNIX File System ** wizard.
138
+
139
+
140
+
### Option 3 - Deploying using CICS Explorer (Remote System Explorer) and CICS Bundle ZIP
141
+
1. Connect to USS on the host system
142
+
2. Create the bundle directory for the project.
143
+
3. Copy & paste the built CICS bundle ZIP file from your *projects/cics-java-osgi-link-bundle/target* or *projects/cics-java-osgi-link-bundle/build/distributions* directory to z/FS on the host system into the bundle directory.
144
+
4. Extract the ZIP by right-clicking on the ZIP file > User Action > unjar...
145
+
5. Refresh the bundle directory
146
+
147
+
148
+
### Option 4 - Deploying using command line tools
149
+
1. Upload the built CICS bundle ZIP file from your *projects/cics-java-osgi-link-bundle/target* or *projects/cics-java-osgi-link-bundle/build/distributions* directory to z/FS on the host system (e.g. FTP).
150
+
2. Connect to USS on the host system (e.g. SSH).
151
+
3. Create the bundle directory for the project.
152
+
4. Move the CICS bundle ZIP file into the bundle directory.
153
+
5. Change directory into the bundle directoy.
154
+
6. Extract the CICS bundle ZIP file. This can be done using the `jar` command. For example:
155
+
```shell
156
+
jar xf file.zip
157
+
```
158
+
159
+
---
72
160
73
-
1. CICS resource definitions for the bundle, programs, transactions and a JVM server are supplied in a group CDEVSAMP as a DFHCSDUP sample input stream supplied in [`DFHCSD.txt`](etc/DFHCSD.txt). Alternatively they can be installed using the bundle parts supplied with the cics-java-osgi-link-bundle project.
74
-
Note that the resource definitions for the CICS programs `CDEVMCLC` and `CDEVMCTC` for the Channel sample are not supplied as they will be autoinstalled by the processing of @CICSProgram annotation.
161
+
## Installing the CICS bundle
162
+
### Installing the CICS bundle from a CICS terminal
163
+
1. Create a new bundle definition, setting the bundle directory to the deployed bundle directory:
0 commit comments