<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Russell Shaw on Medium]]></title>
        <description><![CDATA[Stories by Russell Shaw on Medium]]></description>
        <link>https://medium.com/@russell.shaw?source=rss-900c7700ca1a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oLBhbMWVWNbH6pEXvYDZDw.jpeg</url>
            <title>Stories by Russell Shaw on Medium</title>
            <link>https://medium.com/@russell.shaw?source=rss-900c7700ca1a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:41:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@russell.shaw/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using GraalJS in Z/OS CICS Liberty]]></title>
            <link>https://medium.com/@russell.shaw/using-graaljs-in-z-os-cics-liberty-b88543fbf699?source=rss-900c7700ca1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b88543fbf699</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ibm-cics]]></category>
            <category><![CDATA[mainframe]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Russell Shaw]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 02:00:35 GMT</pubDate>
            <atom:updated>2026-01-20T02:00:35.523Z</atom:updated>
            <content:encoded><![CDATA[<p>In one of my recent previous articles, I mentioned how you can potentially leverage <strong>OpenJDK Nashorn in CICS Liberty</strong>. In this article I will go through the same exercise with <strong>GraalJS</strong> <strong><em>(</em></strong><a href="https://www.graalvm.org/javascript/"><strong><em>https://www.graalvm.org/javascript/</em></strong></a><strong><em>)</em></strong></p><p>The blog is mainly for my own reference, but I hope that someone else may find this useful also.</p><p>The official website will say that <strong>GraalJS is a fully compliant ECMAScript Javascript runtime</strong>, built on top of <strong>GraalVM</strong>. GraalVM is an alternative JVM that does ahead-of-time compilation into native machine code, to be used as an alternative to Hotspot and OpenJ9.</p><p>Oracle are actively pushing GraalVM as the JVM of choice. <br>However, <strong>GraalJS also still runs on standard JVMs such as Hotspot and OpenJ9</strong> (albeit slower, as those engines rely on run-time JIT).<br>On Z/OS, we have a custom version of OpenJ9 called IBMJ9, but for all intensive purposes is same as OpenJ9.</p><p><strong>Why GraalJS instead of Nashorn ?</strong></p><p>GraalJS runs current ECMA revisions, so is far more modern, and has a lot more active support than Nashorn does.</p><p>It also lets you select the level of compliance you need from ECMA 5 thru to current standards.<br>It also supports Web Assembly.<br>It also runs some NodeJS modules also, although I never tested this.</p><p>Like Nashorn, being Java based, it runs on the T8 TCB and is ZIIP eligible for the majority of the workload, which is a big deal.</p><p>Like Nashorn, you can also leverage any Java class you like from Javascript, including JCICS.</p><p>General info about using GraalJS can be found here : <a href="https://github.com/oracle/graaljs"><strong><em>https://github.com/oracle/graaljs</em></strong></a></p><p>I successfully duplicated the similar setup in Liberty I had for Nashorn, where I created a CICS Liberty WebApp using either CICS LINK PROGRAM interface, or JAX-RS interface, with OpenApi page as a test page to drive/test the JAX-RS.</p><p><strong>I did run into difficulties, which I overcame after some efforts…</strong></p><p>The standard artifacts pulled from Maven did not run on Z/OS, due to internal checking of valid OS and CPU architectures.</p><p>See issue I raised here for more info : <a href="https://github.com/oracle/graal/issues/11209"><strong><em>https://github.com/oracle/graal/issues/11209</em></strong></a></p><p>As mentioned in the issue, I overcame this by pulling source from github, patching the code (see<strong><em> </em></strong><a href="https://github.com/oracle/graal/pull/10990/files"><strong><em>https://github.com/oracle/graal/pull/10990/files</em></strong></a> ) and building my own artifacts. <br>Below is part of the update…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XqiR1PeUJb4lwCvQe1-5rw.png" /></figure><p>I don’t want to bore everyone with details, but suffice to say if you just follow the offical build instructions from the official website, you will build artifacts using a tool called mx, and then manually copy required jars into your maven project. <a href="https://github.com/oracle/graaljs/blob/master/docs/Building.md"><strong><em>https://github.com/oracle/graaljs/blob/master/docs/Building.md</em></strong></a></p><p>As I built my own artifacts, it meant that I then had to manually add them as resources into my web project, and exclude them as dependencies in my maven pom.xml. Initially this seemed unfortunate, but it also meant that I could exclude a lot of unnecessary jars that are not needed, which just create a lot of bloat in the large archive size. So in the end it was a win in terms of control.</p><p>As of current release, my patches may not be needed, as the GraalJS team have updated the codebase to not fail on unrecognized OS/architecture. I have not tested this to confirm, as I was still using 24.2.x.</p><p>So, even if the patches are no longer needed, I would still recommended rebuilding manually, and selectively including just the artifacts you need (there is a bit of trial and error required, but with the selection I chose, I never ran into any issues). Alternatively you could try adding maven rules to exclude jars from the resulting war.</p><p>I also had to avoid using maven shade, as this messed up the build, due to class naming clashes within different classes used by GraalJS. This made my resulting pom.xml a bit simpler.</p><p>Like with my previous Nashorn work, after building on my MacBook, I manually copied to a bundle folder on USS.</p><p>Note: When installing the CICS bundle, I first disabled my previous Nashorn bundle, as the featurempOpenAPI-1.1only works on one JAX-RS application at a time (ie. the first loaded), although both apps can actually run at same time (just not the OpenAPI part).</p><p>When running, I set 1 property and 1 option to stop a nag messages, saying that GraalVM compiler not present / running in interpreted mode etc, as that message was annoying :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBqn11GppiFyp7DTZay0yQ.png" /></figure><p>The are probably a lot of subtle things I did that may be of interest, so please refer to the code snippets shown at the bottom of the article…</p><p><strong>Performance</strong></p><p>I found the speed was pretty good, although typically not as fast as Nashorn (in some cases twice as slow). Maybe after JVM warms up on a script, it could get faster, but I was happy with what I saw. It also gained a lot in functionality in both configurable ECMA level and also Web Assembly support.</p><p><strong>Overall conclusion</strong></p><p>Although slower than Nashorn for many cases, I feel the benefits outweigh the cons, and people should not hesitate to use this engine.</p><p><strong>For reference to anyone interested, below was my project setup :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*mI4US_YrYDKxDyuXWR5h3w.png" /><figcaption>Project folder setup</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Os5Kf6FgI9p6V2sb3fStrQ.png" /><figcaption>web.xml</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twD5iMml7E3kDwL_b5CYkg.png" /><figcaption>pom.xml</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfyVdJiR5ruKzVEqjc7tBw.png" /><figcaption>pom.xml (graaljs-app)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ulN6R6sbF-Secp_BrG0mcg.png" /><figcaption>pom.xml (graaljs-bundle)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IYXlm0G4kj6JzuuJxRAyyw.png" /><figcaption>JavaScriptResource.java</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7nVEIAr7qggcFVilp_fl1Q.png" /><figcaption>JavaScript.java (part1 of 3)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wxm_CIioU0GM1EdRyMZC7w.png" /><figcaption>JavaScript.java (part 2 of 3)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qsvbLyhLTQx9ewdA483tZA.png" /><figcaption>JavaScript.java (part 3 of 3)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b88543fbf699" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using OpenJDK Nashorn within CICS Liberty (for Server-side Javascript)]]></title>
            <link>https://medium.com/@russell.shaw/using-openjdk-nashorn-within-cics-liberty-for-server-side-javascript-5acc06349894?source=rss-900c7700ca1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5acc06349894</guid>
            <category><![CDATA[liberty]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[ibm-cics]]></category>
            <dc:creator><![CDATA[Russell Shaw]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 22:08:26 GMT</pubDate>
            <atom:updated>2026-01-19T18:53:05.662Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>OpenJDK Nashorn</strong> is a <strong>JavaScript</strong> engine written in Java that was included in the Java Development Kit (JDK) from version 8 to 14. <strong>Now it is a separate project, run under the OpenJDK umbrella, and can run on any JVM.</strong></p><p>Please refer to official website for more info : <a href="https://github.com/openjdk/nashorn">https://github.com/openjdk/nashorn</a></p><p>As it is written in pure Java, it becomes an option when wanting to enable server-side scripting on Z/OS.</p><p><strong>The perceived upsides :</strong></p><ul><li>Small footprint</li><li>easy to integrate into your Java projects</li><li>compiles into native java byte code, then executed by the JVM</li><li>still actively supported</li><li>due to being Java based, runs on T8 TCB and is therefore ZIIP eligible</li><li>integrates nicely with Java, so can mix and match, and share methods.</li></ul><p><strong>The perceived downsides :</strong></p><ul><li>ECMA 5/6 is not the current</li><li>Time/CPU cost of jumping to and from legacy CICS languages</li><li>existing biases against Java in the mainframe community</li></ul><p><em>Personal thoughts here :<br> 1) ECMA is only a problem if you make it a problem. A lot of the new features may not actually be relevant to server side, and then you gain all the extras from Java which should surpass anything you miss from ECMA. <br>2) Nashorn runs remarkably fast (even faster after JVM warms up)<br>3) if run lots of short-lived non-Java based JNI workloads, then TCB swaps can impact, but then you should really redesign such workloads to be more intelligent to mitigate this.</em></p><p>So for my proof of concept, I wanted it to be run under Liberty as a normal Java JAX-RS (Java restful service) app, but also be callable from any CICS program. Luckily CICS Liberty provides both of these options. <br>This also means, that to run as a Web app, I can later potentially leverage various features available via Liberty, that are not available if using CICS Web Services</p><p><em>To cut a long story short, if you are already tired of reading, you can find my complete solution here:</em><br><a href="https://github.com/kiwi1969/cics-nashorn/tree/main">https://github.com/kiwi1969/cics-nashorn</a></p><h3><strong>Below is some more details of what you will see in the above example (for those that choose to read on)</strong></h3><p><strong><em>You may want to open the Github link, and view side-by-side to better understand what I am talking about)</em></strong></p><p>The first thing you notice, is that I used Maven build system. This allows me to use Visual Studio Code as IDE, and avoid using Eclipse and any proprietary IBM Eclipse plugins/wizards for Java development.<br>The Maven script runs 2 projects, the first one builds the web app, and the 2nd one creates a CICS bundle. <br>People familiar with <strong>Java within JCICS</strong> will be right at home here. I manually deployed the bundle to USS filesystem via binary ftp, as extra setup is needed to auto-deploy, and I figure it isn’t that hard to do manually.</p><p>If you look at the Java code, you will see I have both a <strong>JavaScript.java</strong> file for the main implementation, and a <strong>JavaScriptResource.java</strong> file</p><p>For the <strong>jax-rs</strong> implementation, that in turn references the JavaScript.java file. This is a typical design pattern for jax-rs. The jax-rs stuff there defines the various mapping rules to handle web request/response, and again is pretty much standard.</p><p>Then in the JavaScript.java we have the actual app.</p><p>It is important to note that we have multiple entry points here</p><ul><li><strong>static code</strong> that only runs once</li><li>Jax-RS requests will execute various methods to be executed directly, based on the Web request eg <strong>eval()</strong>, <strong>evalURL()</strong>, <strong>versionString()</strong></li><li>CICS requests will call <strong>nashorn()</strong>. <br>ie the annotation on the prior line defines a CICS program named NASHORN, which maps to nashorn()</li><li>execution from a command line will run <strong>main()</strong> method. <br>Basically this method will not trigger in CICS, but is useful for sanity testing via a simple “hello world” script, on PC/Mac in VSCode, before uploading.</li></ul><p>There are various other subtle things, such as runtime options to select ecma 6 partial support, strict js parsing etc. A lot of this won’t make complete sense unless you do some more readings.</p><p>One of the things I really like, is that I can call any Java class/method from within a Nashorn script. So I can use <strong>JCICS</strong>, <strong>JZOS</strong> etc out of the box, or 3rd party stuff like <strong>Kafka</strong>.</p><p>Another thing I really like, is to use the <strong>mpOpenAPI-1.1 feature</strong> in CICS Liberty, then Liberty will automatically generate an OpenAPI/Swagger document and test page for you!</p><p>People may appreciate the ability to just change their JavaScript and not have to recompile/redeploy as you do with Java applications</p><p><strong>To Summarize</strong><br>Some will prefer just using Java directly, and not touch JavaScript at all — that is fine. It is always good to have options though when developing!<br>But if you ever need a scripting engine then Open Nashorn is a strong contender.</p><h3><strong>The more astute will ask, why do I have static methods that initialize stuff ?</strong></h3><p><strong>This is because I am taking advantage of the persistent nature of Java in CICS.</strong></p><p><strong>Let me explain…</strong></p><p>On other platforms, your Java program runs in own JVM, and when programs ends, your JVM shuts down, you get garbage collected, and you lose everything. <br>However in CICS, the JVM is global, and any static objects at top scope are not garbage collected until the JVM shuts down, which it doesn’t do (unless you force it via a CEMT command, or it crashes)).<br>This means that in CICS, we can persist global data in static objects, and also not have to reconstruct objects each invocation. This is a real time-saver and gives us a good performance boost also</p><p><strong>I get it, but why would you want to do that ?</strong></p><p>For Nashorn, whenever you run a script, it caches the generated byte code between runs internally, until the engine shuts down. This makes things faster and more efficient. So ideally, we never want to shutdown the ScriptEngine, so we declare 1 globally, and use that for all subsequent requests. We could create multiple ScriptEngines, but then it would only be useful if each ScriptEngine had a unique configuration.</p><p><strong>But what about parallel threads, won’t this cause an issue ?</strong></p><p>Actually, no. Each ScriptEngine is thread safe, and we can safely have multiple invocations of same program at same time, running in same engine.<br>In other engines, we may need to have multiple engines, and maybe have other restrictions such as only one instance of a specific program being allowed to run simultaneously in a single engine, but not Nashorn!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5acc06349894" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing zOSConnect Designer on M1 Macbook]]></title>
            <link>https://medium.com/@russell.shaw/installing-zosconnect-designer-on-m1-macbook-f01bfed2edf0?source=rss-900c7700ca1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f01bfed2edf0</guid>
            <category><![CDATA[mainframe]]></category>
            <category><![CDATA[zosconnect-designer]]></category>
            <category><![CDATA[macos-arm64]]></category>
            <dc:creator><![CDATA[Russell Shaw]]></dc:creator>
            <pubDate>Wed, 05 Jun 2024 18:31:20 GMT</pubDate>
            <atom:updated>2024-06-07T13:07:40.269Z</atom:updated>
            <content:encoded><![CDATA[<p>IBM have a reasonable looking webpage <a href="https://www.ibm.com/docs/en/zos-connect/zos-connect/3.0">here</a> for zOSConnect 3.0, which documents a lot of the steps for both z/OS installation and Workstation installation, which was pretty decent, until I later ran into issues with the zOSConnect Designer on my MacBook Pro M1.</p><p>In this article I will try to explain the issues I encountered, and how I overcame them.</p><p><strong>Background.</strong></p><p>My company wanted me to investigate how zOSConnect is installed onto Z/OS, and how to configure it to accept API requests via HTTP and send requests to CICS regions to trigger an action.</p><p>Then they wanted me to install, and setup a sample API to our test system CICS region to see it in action.</p><p>I decided to initially try the built-in inventory demo app, as mentioned in their samples, and shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*YwA76mvLmeyvHPOw" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/0*jT7OQGrQaPYTr1rd" /></figure><p><strong>Issue 1— Java release.</strong></p><p>Note that this zosConnect demo used a pre-generated API using Java8, which uses jax-ws, which is not available in Java 11 or Java 17. Because of this, the given solution failed on my zOSConnect with jax-ws related errors. This may self resolve if the API is rebuilt using zOSConnect Designer with Java11 or Java17. But regardless, after reverting JAVA_HOME to Java 8.0_64 I gave it another go.</p><p>The Swagger page provided by zOSConnect for the demo worked flawlessly (under Java8.0_64) , as shown below (A very positive start).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qDaOhRJgTFinLAieEEaLpw.png" /></figure><p>But then I had the task of configuring my own API.</p><p><strong>Task — Configuring own API</strong></p><p>Seems that after having a working zOSConnect server (uses own instance of Liberty via a started task), the process is that you :</p><p>1) initially define an API using the OpenAPI Swagger page <a href="https://editor.swagger.io/">here</a></p><p>2) then export that file, and load it into zOSConnect Designer to define the extra info needed to orchestrate that API (such as calling a specific program in CICS)</p><p>3) it then generates a specific Java app for the zOSConnect server on Z/OS to enable that API.</p><p>4) Update some configuration entries in server.xml for the zOSConnect server running on Z/OS, so that the connections needed by the API are available (in my case IPIC connection to my CICS region)</p><p>More info: <a href="https://www.ibm.com/docs/en/zos-connect/zos-connect/3.0?topic=apis-developing-zos-connect-designer">https://www.ibm.com/docs/en/zos-connect/zos-connect/3.0?topic=apis-developing-zos-connect-designe</a></p><p><strong>So I have the prerequisite of needing zOSConnect Designer.</strong></p><p>I am not doing a corporate install or anything, I went for the simpler docker desktop deployment</p><p>Notice that when following the instructions given, IBM ask you pull a docker image from their site and launch using Docker Desktop</p><p><strong>Issue 2— Docker.</strong></p><p>My company doesn’t want us to use docker as it is no longer free. So after some invesigation to confirm that we can use alternative tools instead of docker, I decided to use podman instead.</p><p>I installed via homebrew, using the commands below:</p><p><em>brew install podman</em></p><p><em>alias docker=podman</em></p><p><em>(I also set alias in ~.zshrc so it would be permanent, so if I ever type in docker by mistake, the system will actually run podman)</em></p><p><em>brew install — cask podman-desktop</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4LPfuUTZzn-_BKvX" /><figcaption>Podman desktop running</figcaption></figure><p><em>podman machine init — cpus 4 — memory=6144</em></p><p><em>podman machine start</em></p><p><em>podman machine list</em></p><p><em>docker pull icr.io/zosconnect/ibm-zcon-designer:3.0.81</em></p><p>The above command fails on Apple Silicon (eg Apply M1).</p><p><strong>Issue 3— Image is not compatible with ARM64 architecture.</strong></p><p>After reading and finding numerous postings about specifying — arch options etc no no avail, I found a solution.</p><p>The solution is to supply this extra parameter, to tell QEMU to emulate the x86 processor (only options were linux/s390 and Linix/amd64) . Perhaps IBM should update their webpage to include this parameter</p><p><em>docker pull icr.io/zosconnect/ibm-zcon-designer:3.0.81 — platform linux/amd64</em></p><p>Then we bring up the image docker docker image with this command:</p><p><em>docker compose up -d</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GYstesG5PdLHX4Hn" /><figcaption>We see above that the zConnect image is running</figcaption></figure><p>This is what you see when trying to access the page.</p><p><em>Note1 you may get a warning in Safari complaining that the site is unsafe. But an option in the page lets you continue anyhow.</em></p><p><em>Note2 if using Chrome, you get a warning screen complaining that the site is not secure, but seemingly cannot continue to the site. The trick to get past this screen you need to click anywhere on that page, and then type </em><strong><em>thisisunsafe</em></strong><em> on the error form. Then Chrome will let you visit the page</em></p><p>We go to the webpage and yes it is working! <a href="http://localhost:9080/zosConnect/designer">http://localhost:9080/zosConnect/designer</a> or <a href="https://localhost:9443/zosConnect/designer">https://localhost:9443/zosConnect/designer</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fb2KNo9zDjM4F-dL" /></figure><p>I have no idea what JVM release is being used in this containerized version of the Designer, but I would expect it to no longer be Java8, so that we are no longer forced to run zOSConnect using Java 8 (which is nearing end of life in 2026).</p><p>ie I think everyone should really be jumping to Java 11 at a minimum on z/OS (preferably Java 17).</p><h4>I Hope this helps anyone who was struggling with this.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f01bfed2edf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>