Tomcat on AS400 (aka i-series, Systemi, IBM i, bla, bla…)

I know that AS400 gives its own native support to Tomcat and other application servers, but it does it in the IBM style: intricate and rigid. What if, for example, I need to use a version of Tomcat that it is not shipped with my operating system?
Here is one possible answer:

1) Download a copy of Apache Tomcat and unzip it in a directory of the Integrated File System of AS400.

2) In another directory of the Integrated File System Create a text file named tomcat with a simple script like this:

#The path of the JDK you want to use
export JAVA_HOME=/QIBM/ProdData/Java400/jdk14  

#The JVM option you want to use
#In this example -opt0 means 'no optimization'
export JAVA_OPTS='-opt0 -Djava.awt.headless=true'  

cd /path/to/my/tomcatdir/bin
catalina.sh %1

3) In a 5250 session (or in a batch job) execute this command

QSH CMD('/path/to/my/script/tomcat run')

Your Tomcat should be alive and kicking :-)

4) In order to shut down Tomcat, use this command

QSH CMD('/path/to/my/script/tomcat stop')

Enjoy with Tomcat and AS400!!!

Lascia un commento