Blog Archive

Install Tomcat on iSeries - As400 Tomcat 6.0 installation steps

How to Setup Tomcat as Stand-Alone Server on iSeries

Here we are going to download a fresh copy of the Tomcat from the Apache website and run it as a Stand Alone Server. Basically hitting the Tomcat directly without going thru Apache Web Server. In the next part I am going to connect it to the Apache Web Server.

Useful Links:

Follow the Steps:

1) Go to the Apache Tomcat Home page and down the zip file for the version you want to install. Before choosing a version make sure you have compatible Java version already installed on the iSeries. I am going to install the Tomcat 6.0
Servlet/JSP Spec Apache Tomcat version Actual release revision Minimum Java Version
3.0/2.2    7.0.x     7.0.14     1.6
2.5/2.1    6.0.x     6.0.32     1.5
2.4/2.0    5.5.x     5.5.33     1.4
2.3/1.2    4.1.x (archived)  4.1.40 (archived)  1.3
2.2/1.1    3.3.x (archived)  3.3.2 (archived)  1.1

I went and downloaded

2) Create a IFS directory called apache where we are going to install the zip file.
MD DIR('/apache')

3) Now FTP the to the /apache directory. You can download Filezilla for this, its free - FileZilla Home Page


Use the DOS command prompt FTP
ftp {system_name or IP Address}
Enter UserId
Enter Password

quote site na 1
put /apache/

4) Unzip the file in the /apache directory
Once you have the Zip file on your iSeries, start a Qshell session, using the command QSH. Change to /apache directory and extract the Zip file, using the following commands:
cd /apache
jar -xf

5)After the file unzips you will see the sub directory apache-tomcat-6.0.32 created under /apache directory. Your can drill down and see Tomcat directory structure

Install Tomcat 6.0 on iSeries As400

6)Now that you have Tomcat on your system, you should compile and optimize all of the JAR files packaged with Tomcat. This takes a while ..(This step is optional)
SBMJOB CMD(QSH CMD('for jar in $(find /apache/apache-tomcat-6.0.32/ -name ''*.jar''); 
do system "CRTJVAPGM CLSF(''"$jar"'') OPTIMIZE(40)";done')) 

7)Modify file. Its available under bin directory. In my case here is the path

Look for os400=false and update it to os400=true

8) CL program to start the Tomcat 6.0 Server
ADDENVVAR  ENVVAR(JAVA_HOME) +                            
MONMSG     MSGID(CPF0000)                                 
SBMJOB     CMD(QSH +                                      
   ')) JOB(CATALINA) JOBQ($jobqName) +        
             CPYENVVAR(*YES) ALWMLTTHD(*YES)              

9) If your Tomcat Server doesn't start check the log file. Log file resides in 


In my case the path is /apache/apache-tomcat-6.0.32/bin/
CATALINA_HOME = /apache/apache-tomcat-6.0.32

If you see the following error
Caused by: java.lang.UnsatisfiedLinkError: no cmm in java.library.path

then you have to update you Java system properties file

Add the following lines

10) Make sure your Tomcat Sever in running, Sample log info for successful start
May 27, 2011 4:19:14 PM org.apache.coyote.http11.Http11Protocol init                    
INFO: Initializing Coyote HTTP/1.1 on http-8080                                         
May 27, 2011 4:19:14 PM org.apache.catalina.startup.Catalina load                       
INFO: Initialization processed in 9827 ms                                               
May 27, 2011 4:19:15 PM org.apache.catalina.core.StandardService start                  
INFO: Starting service Catalina                                                         
May 27, 2011 4:19:15 PM org.apache.catalina.core.StandardEngine start                   
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32                                     
May 27, 2011 4:19:15 PM org.apache.catalina.startup.HostConfig deployDescriptor         
INFO: Deploying configuration descriptor host-manager.xml                               
May 27, 2011 4:19:19 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml                           
May 27, 2011 4:19:22 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory ROOT                                 
May 27, 2011 4:19:22 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory docs                                 
May 27, 2011 4:19:23 PM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory examples                             
May 27, 2011 4:19:26 PM org.apache.coyote.http11.Http11Protocol start          
INFO: Starting Coyote HTTP/1.1 on http-8080                                    
May 27, 2011 4:19:26 PM org.apache.jk.common.ChannelSocket init                
INFO: JK: ajp13 listening on /                                     
May 27, 2011 4:19:26 PM org.apache.jk.server.JkMain start                      
INFO: Jk running ID=0 time=0/378  config=null                                  
May 27, 2011 4:19:27 PM org.apache.catalina.startup.Catalina start             
INFO: Server startup in 12785 ms    

11) Check the Tomcat Home Page, Type the following on your web browser
Sample Apache Tomcat 6.0 Home Page

12) To use the Tomcat Manager you need a user profile setup for manager role. Go to


Add the following lines after <tomcat-users>
<role rolename="manager"/>                                 
<role rolename="admin"/>                                   
<user username="{your user id}" password="{your password}" roles="admin,manager"/>

13) For these changes in user config to take place you have to restart the Tomcat Server. So lets Stop the server. Here is a sample CL program to stop the Tomcat 6.0 Server
ADDENVVAR  ENVVAR(JAVA_HOME) +                           
MONMSG     MSGID(CPF0000)                                
SBMJOB     CMD(QSH +                                     
   ')) JOB(CAT_END) JOBQ($jobqName) +      
             CPYENVVAR(*YES) ALWMLTTHD(*YES)             

13) Start the Tomcat Server again and you are all set !

Recommended Reading


  1. We noticed some strangeness when applying this procedure to Tomcat 7:

    With Tomcat 6, when I start Tomcat, the "CATALINA" job
    brings up the server, then ends, leaving the server active.

    But with Tomcat 7, when I start it, the "CATALINA" job remains active,
    and if I abend it, it takes the server with it.

    Is this normal? Is there some setting that needs to change? Something in
    one of the scripts? Something in the CL program that initiates the whole

    I'm asking the same question a few other places.

    James H. H. Lampert
    Touchtone Corporation

    1. Hi.. have you solve your problem regarding this? please share.. i'm facing same problem also..
      and in my case, it appears on logs : org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[[]]

  2. James,

    I haven't installed Tomcat 7 yet. When I do it next time I will try and let you know. If you get your question answered please share it, so it can help others.

  3. A member of the Java list on has experienced the same thing as I described, and as far as he knows, it's "just the way it works."

    Given that, I simply adjusted the CL programs to use a *JOBD that is guaranteed never to clog a "one-at-a-time" *JOBQ.

  4. And now, we tried to install it on a customer's V7 box, and hit a brick wall: CATALINA crashes on takeoff, because Java is not where it's expected to be.

    According to GO LICPGM, Java 6 is present.

    But according to WRKLNK, it's not where it is on a V6 box.

    Any ideas?


  5. James H. H. LampertJanuary 9, 2012 at 5:03 PM

    Do you know anything about getting SSL support up?

    I was referred to:

    I've tried, both with an explicitly named and located keystore (and password), and with the defaults. So long as I'm not trying to access a nonexistent keystore, I get: Keystore was tampered with, or password was incorrect

  6. I never done it but will give it a try in a few days and let you know. I have always put Apache in front of Tomcat for SSL.

    One thing is for sure from the error is that your server.xml config is good and its finding the keystore but the password doesn't match. I have worked with Android apps and they need to be created with keystore and if you forget the password then it will give the same message. Check your CCSID for server.xml file make sure you have 819.

  7. James H. H. LampertJanuary 23, 2012 at 12:45 PM

    More weirdness, this time with a V5R4 box.

    They have Java 6 installed, and I'm told that they installed some PTFs over the weekend, but it's still crashing on takeoff.

    In, we have:
    > # Java 6 settings if needed
    > export -s JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit/jre
    > export -s CATALINA_HOME=/wintouch/tomcat
    > export -s JAVA_OPTS="-Dos400.awt.native=true -Djava.awt.headless=true -Djava.version=1.6 -Xms256m -Xmx512m"
    > # OS specific support. $var _must_ be set to either true or false.
    > cygwin=false
    > darwin=false
    > os400=true
    > case "`uname`" in
    > CYGWIN*) cygwin=true;;
    > Darwin*) darwin=true;;
    > OS400*) os400=true;;
    > esac

    and there is definitely a "java" in the /QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit/jre/bin directory, and so far as I'm aware, all the JARs are present in the right subdirectories of /wintouch/tomcat, but in catalina.out, I get:
    > Attaching Java program to /QIBM/ProdData/Java400/jdk6/lib/charsets.jar.
    > Attaching Java program to /QIBM/ProdData/Java400/jdk6/lib/resources.jar.
    > Attaching Java program to /QIBM/ProdData/Java400/jdk6/lib/rt.jar.
    > eval: 001-0014 Command /QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit/jre/bin/java not found.
    > java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
    > at
    > at java.lang.ClassLoader.loadClass(
    > at java.lang.ClassLoader.loadClass(
    > at org.apache.catalina.startup.Bootstrap.init(
    > at org.apache.catalina.startup.Bootstrap.main(

    When I delete catalina.out and try again, I get the same, only starting from the ClassNotFoundException.

    Any idea what the problem could be here?


  8. Do not modify Create a CL program as explained above.

    CMD('/apache/apache-tomcat-6.0.32/bin/start+')) JOB(CATALINA) JOBQ($jobqName) +

    Anyway, looking at your log it seems like picking up java from /QIBM/ProdData/Java400/jdk6

    as shown in the log by this line
    > Attaching Java program to /QIBM/ProdData/Java400/jdk6/lib/charsets.jar.

    Try changing the export of JAVA_HOME to

    export -s JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit

  9. Hi.
    Do you know how to connect to db2 on linux through jdbc from a tomcat installation on system I ? when i try with the war unmodified i get an error: "not in relational database" error.
    On trying to access the database from tomcat this error is trown.. Relational database not in relational database directory.
    The driver is setup as follows:
    Driver connection string: jdbc:db2://