Run Embedded Tomcat as a started task with Web Viewer 12.1 for USS

Document ID : KB000010797
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

Here is a JCL example for running Tomcat as a started task using your current installed Web Viewer with the embedded Tomcat from a full install of Web Viewer.

There is also another alternative from our CA Common Services Group (CCS).  In this case, the embedded Tomcat in not used. That would be a separate install of Tomcat where you would then deploy the Web Viewer basic install WAR files.

Instructions:
This is sample JCL for running embedded Tomcat as a Started task.  Please see the comment for customization information:

//STCJTOM1 JOB (115300000),'APACHE TOMCAT',MSGCLASS=X, // CLASS=C //* //********************************************************************* //* DESCRIPTION: TOMCAT Web Server BATCH job //* Used by Output Management development. //* 64-bit JVM (normal) //********************************************************************* //* //* Usage Notes: //* o The Apache Tomcat folders are on a USS file system that is not //* mounted by default. DETAILS TO FOLLOW. //* o Consider adding step to mount the USS file system //* //* Started task to run the Tomcat under JDK 1.6 //* //* Tailor the STDENV member for your installation: //* 1.) Modify JZOS_HOME to point to the hfs directory where JZOS //* was installed, //* 2.) edit JAVA_HOME to point the location of the 1.6 JDK //* 3.) edit TOMCAT_HOME to point to the Tomcat root hfs directory //* 4.) Modify JAVACLS and ARGS to launch desired Java class //* //********************************************************************* //PRTOMCAT PROC LEPARM=, < Optional LE parm // ARGS='start', < Args to Java class //*LIBRARY='MVSSYS.JAVA31BT.V6R0M0.SR5.SIEALNKE', <JZOSVM lib // JAVACLS='org.apache.catalina.startup.Bootstrap', < Java Start //*VERSION='60', < JVM version 6.0 (31 bit) //*VERSION='61', < JVM version 6.0.1 (31 bit) //*VERSION='66', OK < JVM version 6.0 (64 bit) //*VERSION='67', OK < JVM version 6.0.1 (64 bit) //*VERSION='70', < JVM version 7.0 (31 bit) //*VERSION='76', OK (eratic) < JVM version 7.0 (64 bit) // VERSION='77', OK < JVM version 7.1 (64 bit) //*VERSION='86', OK < JVM version 8.0 (64 bit) //*TCPDATA='VTAM.TCPIP.TCPIP.DATA', < SYSTCPD dsn from TCPIP proc //*LOGLVL=' ' < Set log level to none // LOGLVL='+I' < Set log level to Info //*LOGLVL='+T' < Set log level to Trace //*LOGLVL='+D' < Set log level to debug //* //* //* Start the Tomcat Server //* //TOMCAT EXEC PGM=JVMLDM&VERSION,REGION=0M, //*TOMCAT EXEC PGM=JVMLDM&VERSION,REGION=0M,MEMLIMIT=5G, //*TOMCAT EXEC PGM=JVMLDM&VERSION,REGION=1024M, //*TOMCAT EXEC PGM=JVMLDM&VERSION,REGION=7M, // PARM='&LEPARM/&LOGLVL &JAVACLS &ARGS' //*STEPLIB DD DSN=&LIBRARY,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //STDOUT DD SYSOUT=* //STDERR DD SYSOUT=* //CEEDUMP DD SYSOUT=* //*SYSTCPD DD DISP=SHR,DSN=&TCPDATA // PEND //EXTOMCAT EXEC PRTOMCAT //STDENV DD * # # This member contains all the environment variables # used by the JVM to start the Tomcat server for a # a particular product # # 1.) Edit INSTALL_HOME to point to the USS path # that contains the deployed CA Common Services for z/OS # Tomcat directory. # # 2.) Edit PRODUCT_HOME to point to the USS path # for this Tomcat product instance. The path should # not include the /tomcat dir itself. # # 3.) Edit the CATALINA_HOME Common Services /tomcat directory # name if required. /tomcat will always point at the # default tomcat release that common services is # delivering and may change to a higher release if # CCS maintainence is applied or a new release of CCS is # installed. If a product needs a particular release of # Tomcat use this directory naming- /apache-tomcat-v.r.nn # where v is version, r is release, and nn is modification # level. CA Common Services will deliver .nn levels as PTFs # and new v.r levels as new FMIDs. New v.r levels can be # controlled with the CATALINA_HOME setting. Older .nn # levels within a v.r level will not be available for # choosing here. # # 4.) Edit JAVA_HOME to point to the location of the JDK # # 5.) If you are using 64 bit Java, change the s390 directory # to s390x in the LIBPATH. From the command line, issue: # C /s390 /s390x all # # Note: The default options are set for 31 bit Java v6. # 64 bit Java v6 is also supported. # #INSTALL_HOME=/cai/CADeploy/CCS/tpv #PRODUCT_HOME=/cai/CADeploy/productx #7.0.34#INSTALL_HOME=/u/users/omdev/apps/ccstomcat7/base/CCS/tpv #7.0.40#INSTALL_HOME=/u/users/omdev/apps/ccstomcat7/CCS/tpv INSTALL_HOME=/u/users/omdev/apps/ccstomcat7/CCS/tpv PRODUCT_HOME=/u/users/omdev/apps/omwstomc #CATALINA_HOME="${INSTALL_HOME}"/apache-tomcat-7.0.34 CATALINA_HOME="${INSTALL_HOME}"/tomcat CATALINA_BASE="${PRODUCT_HOME}"/tomcat ## Override for temporary QA testing (Web Viewer 12.1.2 embedded Tomcat) ###DVWEB=/u/users/omdev/apps/dvweb_12_1_2/CA_OM_Web_Viewer ###TOMCAT=/apache-tomcat-7.0.42 ###CATALINA_HOME="${DVWEB}${TOMCAT}" ###CATALINA_BASE="${DVWEB}${TOMCAT}" ## Override for temporary testing (Web Viewer 12.1.2 embedded Tomcat) ##DVWEB=/u/users/omdev/apps/dvweb_12_1_2/CA_OM_Web_Viewer ##TOMCAT=/apache-tomcat-7.0.42 ##CATALINA_HOME="${DVWEB}${TOMCAT}" ##CATALINA_BASE="${DVWEB}${TOMCAT}" # For 31-bit JAVA ------------------------------ #export JAVA_HOME=/sys/java31bt/v6r0m0/usr/lpp/java/J6.0 #export JAVA_HOME=/sys/java31bt/v7r0m0/usr/lpp/java/J7.0 # For 64-bit JAVA ------------------------------ #66#export JAVA_HOME=/sys/java64bt/v6r0m0/usr/lpp/java/J6.0_64 #67#export JAVA_HOME=/sys/java64bt/v6r0m1/usr/lpp/java/J6.0.1_64 #76#export JAVA_HOME=/sys/java64bt/v7r0m0/usr/lpp/java/J7.0_64 #77#export JAVA_HOME=/sys/java64bt/v7r1m0/usr/lpp/java/J7.1_64 export JAVA_HOME=/sys/java64bt/v7r1m0/usr/lpp/java/J7.1_64 export PATH=/bin:"${JAVA_HOME}"/bin:"${CATALINA_HOME}"/bin CLASSPATH="${JAVA_HOME}/lib/tools.jar" CLASSPATH="$CLASSPATH":"${CATALINA_HOME}/bin/bootstrap.jar" CLASSPATH="$CLASSPATH":"${CATALINA_BASE}/bin/tomcat-juli.jar" export CLASSPATH="$CLASSPATH": # For 31-bit JAVA ------------------------------ #LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/lib/s390:"${CATALINA_HOME}"/lib #LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/classic # For 64-bit JAVA ------------------------------ LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/lib/s390x:"${CATALINA_HOME}"/lib LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390x/classic export LIBPATH="$LIBPATH": # New environment setting added by CA Output Management Web Viewer r12.1 CAOMWV12_HOME=/u/users/omdev/apps/CA_OM_Web_Viewer_12_1_home export CAOMWV12_HOME # Configure JVM options # Note that Tomcat requires default ASCII file.encoding IJO="$IJO -Dfile.encoding=ISO8859-1" IJO="$IJO -Dcatalina.base=${CATALINA_BASE}" IJO="$IJO -Dcatalina.home=${CATALINA_HOME}" IJO="$IJO -Djava.io.tmpdir=${CATALINA_BASE}/temp" IJO="$IJO -Dibm.serversocket.recover=true" IJO="$IJO -Djava.endorsed.dirs=" IJO="${IJO}${CATALINA_HOME}/common/endorsed" IJO="$IJO -Dderby.system.home=${CATALINA_BASE}/../../derby" IJO="$IJO -Dlog.dir=${CATALINA_BASE}/mfui/logs" IJO="$IJO -Xshareclasses:name=cache1" #IJO="$IJO -Xms256m -Xmx512m" #IJO="$IJO -Xms256m -Xmx1024m" #IJO="$IJO -Xms1024m -Xmx2048m" #IJO="$IJO -Xms1024m -Xmx8192m" #IJO="$IJO -Xms16384m -Xmx16384m" #IJO="$IJO -Xms8192m -Xmx16384m" IJO="$IJO -Xms1024m -Xmx4096m" export IBM_JAVA_OPTIONS="$IJO " export JAVA_DUMP_HEAP=false export JAVA_PROPAGATE=NO export IBM_JAVA_ZOS_TDUMP=NO
Additional Information:

You may also consider the CA Common Services supported Tomcat when getting ready for production.  CA Common Services supports their Tomcat instance, currently at version 8.0.39.  

Information on the CCS Supported Tomcat can be found at the support.ca.com link:
https://docops.ca.com/ca-common-services-for-z-os/14-1/en/installing/ccs-apache-tomcat-installation-deployment-and-configuration