blob: ed798754a102aa9bbf5041b3ca9fee58f2499349 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<link type="text/css" rel="stylesheet" href="/resources/site.css">
<script src='/resources/space.js'></script>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
<meta name="description" content="Apache CXF, Services Framework - Running a service in Tomcat on zOS">
<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shCoreCXF.css">
<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
<script src='/resources/highlighter/scripts/shCore.js'></script>
<script src='/resources/highlighter/scripts/shBrushBash.js'></script>
<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
</script>
<title>
Apache CXF -- Running a service in Tomcat on zOS
</title>
</head>
<body onload="init()">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td id="cell-0-0" colspan="2">&nbsp;</td>
<td id="cell-0-1">&nbsp;</td>
<td id="cell-0-2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td id="cell-1-0">&nbsp;</td>
<td id="cell-1-1">&nbsp;</td>
<td id="cell-1-2">
<!-- Banner -->
<div class="banner" id="banner"><div><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
<a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
</td><td align="right" colspan="1" nowrap>
<a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
</td></tr></table></div></div>
<!-- Banner -->
<div id="top-menu">
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td>
<div align="left">
<!-- Breadcrumbs -->
<a href="index.html">Index</a>&nbsp;&gt;&nbsp;<a href="how-tos.html">How-Tos</a>&nbsp;&gt;&nbsp;<a href="running-a-service-in-tomcat-on-zos.html">Running a service in Tomcat on zOS</a>
<!-- Breadcrumbs -->
</div>
</td>
<td>
<div align="right">
<!-- Quicklinks -->
<div id="quicklinks"><p><a shape="rect" href="http://cxf.apache.org/download.html">Download</a> | <a shape="rect" href="http://cxf.apache.org/docs/index.html">Documentation</a></p></div>
<!-- Quicklinks -->
</div>
</td>
</tr>
</table>
</div>
</td>
<td id="cell-1-3">&nbsp;</td>
<td id="cell-1-4">&nbsp;</td>
</tr>
<tr>
<td id="cell-2-0" colspan="2">&nbsp;</td>
<td id="cell-2-1">
<table>
<tr valign="top">
<td height="100%">
<div id="wrapper-menu-page-right">
<div id="wrapper-menu-page-top">
<div id="wrapper-menu-page-bottom">
<div id="menu-page">
<!-- NavigationBar -->
<div id="navigation"><ul class="alternate"><li><a shape="rect" href="overview.html">Overview</a></li><li><a shape="rect" href="how-tos.html">How-Tos</a></li><li><a shape="rect" href="frontends.html">Frontends</a></li><li><a shape="rect" href="databindings.html">DataBindings</a></li><li><a shape="rect" href="transports.html">Transports</a></li><li><a shape="rect" href="configuration.html">Configuration</a></li><li><a shape="rect" href="debugging-and-logging.html">Debugging and Logging</a></li><li><a shape="rect" href="tools.html">Tools</a></li><li><a shape="rect" href="restful-services.html">RESTful Services</a></li><li><a shape="rect" href="wsdl-bindings.html">WSDL Bindings</a></li><li><a shape="rect" href="service-routing.html">Service Routing</a></li><li><a shape="rect" href="dynamic-languages.html">Dynamic Languages</a></li><li><a shape="rect" href="ws-support.html">WS-* Support</a></li><li><a shape="rect" href="advanced-integration.html">Advanced Integration</a></li><li><a shape="rect" href="deployment.html">Deployment</a></li><li><a shape="rect" href="schemas-and-namespaces.html">Use of Schemas and Namespaces</a></li></ul><hr><ul class="alternate"><li><p>Search</p></li></ul><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
<div>
<input type="hidden" name="cx" value="002890367768291051730:o99qiwa09y4">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" size="21">
<input type="submit" name="sa" value="Search">
</div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script><hr><ul class="alternate"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">API 3.2.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.1.x/">API 3.1.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF Website</a></li></ul><p>&#160;</p><p><a shape="rect" class="external-link" href="http://www.apache.org/events/current-event.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.apache.org/events/current-event-125x125.png" data-image-src="http://www.apache.org/events/current-event-125x125.png"></span></a></p></div>
<!-- NavigationBar -->
</div>
</div>
</div>
</div>
</td>
<td height="100%">
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><p>It is relatively straightforward to run a CXF service in a <a shape="rect" class="external-link" href="http://tomcat.apache.org">Tomcat</a> container on <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Z/OS" rel="nofollow">z/OS</a>. This makes it possible to access data stored on these mainframes, for example in DB2 databases and to expose that data as a Web Service using the same methods used on other platforms. No mainframe specific knowledge or skills are required.</p>
<p>There are a couple of steps:</p>
<ol><li>Copy Tomcat to z/OS and set it up</li><li>Deploy a service</li><li>Test a service</li></ol>
<h3 id="RunningaserviceinTomcatonzOS-CopyTomcattoz/OSandsetitup">Copy Tomcat to z/OS and set it up</h3>
<p>Simply copying Tomcat to z/OS, extracting the jar and running the startup script does not work in the case of z/OS, since z/OS is an EBCDIC platform, instead of an ASCII platform that Tomcat pretty much assumes.</p>
<p>Tomcat needs to be extracted correctly and instead of running it using the startup script, it needs to be executed under the control of <a shape="rect" class="external-link" href="http://www.dovetail.com/docs/jzos/index.html" rel="nofollow">JZOS</a>. JZOS is supplied as part of the IBM JDK on z/OS. If your version of the JDK on z/OS does not include JZOS, you need to obtain a newer version of the JDK that does include it.</p>
<p>Tomcat then needs to be configured and started by following the instructions for <a shape="rect" class="external-link" href="http://www.dovetail.com/docs/jzos/tomcat.html" rel="nofollow">JZOS and Tomcat</a></p>
<p>Sample JCL to run Tomcat looks as follows:</p>
<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>TOMCAT.JCL</b></div><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
//TOMCAT JOB (),
// CLASS=A,
// MSGCLASS=X,
// MSGLEVEL=(1,1),
// NOTIFY=&amp;SYSUID,
// REGION=0M,
// TIME=1440
//PROCLIB JCLLIB ORDER=JZOS.SYS1.PROCLIB
//*
//*********************************************************************
//*
//* Batch job to run Tomcat under JZOS
//*
//* Tailor the proc and job for your installation:
//* 1.) Modify the Job card per your installation's requirements
//* 2.) Modify the PROCLIB card to point to JZOS proclib
//* 3.) Set VERSION='14' for Java 1.4 or VERSION='50' for Java 5
//* 4.) Set JAVA_HOME to point the location of the Java SDK
//* 5.) Set CATALINA_HOME to point to the shared Tomcat install dir
//* 6.) (Optional) set CATALINA_BASE to point to instance specific
//* Tomcat base dir
//*
//*********************************************************************
//*
//JAVA EXEC PROC=JVMPRC50,
//* LOGLVL='+D',
// JAVACLS='org.apache.catalina.startup.Bootstrap',
// ARGS='start'
//STDENV DD *
# This is a shell script which configures
# any environment variables for the Java JVM.
# Variables must be exported to be seen by the launcher.
. /etc/profile
export JAVA_HOME=/space/javaV5_31/J5.0
CATALINA_HOME=/home/userid/tomcat
CATALINA_BASE=${CATALINA_HOME}
export PATH=/bin:"${JAVA_HOME}"/bin:
LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
export LIBPATH="$LIBPATH":
CLASSPATH="${JAVA_HOME}/lib/tools.jar"
CLASSPATH="$CLASSPATH":"${CATALINA_HOME}/bin/bootstrap.jar"
CLASSPATH="$CLASSPATH":"${CATALINA_HOME}/bin/commons-logging-api.jar"
export CLASSPATH="$CLASSPATH":
# Set JZOS specific options
# Use this variable to specify encoding for DD STDOUT and STDERR
#export JZOS_OUTPUT_ENCODING=IBM-1047
# Use this variable to prevent JZOS from handling MVS operator commands
#export JZOS_ENABLE_MVS_COMMANDS=false
# Use this variable to supply additional arguments to main
#export JZOS_MAIN_ARGS=""
# Configure JVM options
# Note that Tomcat requires default ASCII file.encoding
IJO="-Xms64m -Xmx128m"
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 -Djava.endorsed.dirs="
IJO="${IJO}${CATALINA_HOME}/common/endorsed"
# Configure SDK5.0 to use shared classes (at group level)
# You must comment this out if you are not running SDK 5
groupname=`id -gn`
IJO="$IJO -Xshareclasses:name=$groupname,groupAccess"
export IBM_JAVA_OPTIONS="$IJO "
export JAVA_DUMP_HEAP=false
export JAVA_PROPAGATE=NO
export IBM_JAVA_ZOS_TDUMP=NO
//
</pre>
</div></div>
<p>This JCL needs to be updated with your JDK and Tomcat installation locations.</p>
<h3 id="RunningaserviceinTomcatonzOS-Deployaservice">Deploy a service</h3>
<p>Services can be <a shape="rect" class="external-link" href="http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html">deployed</a> as usual for Tomcat. For example, the service WAR file can be FTP-ed to the .../webapps HFS directory or the <a shape="rect" class="external-link" href="http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html">Tomcat Manager</a> can be used to deploy the service. If using FTP or another copy procedure to copy WAR file to z/OS, ensure that the WAR file is copied in binary mode, otherwise it will be ASCII-EBCDIC translated during the FTP and completely corrupted.</p>
<h3 id="RunningaserviceinTomcatonzOS-Testaservice">Test a service</h3>
<p>Just point your SOAP client at the hostname, port and CXF service details of the Tomcat server running on z/OS and the client should run fine. You should not see any difference from running it against a non-mainframe host.</p></div>
</div>
<!-- Content -->
</td>
</tr>
</table>
</td>
<td id="cell-2-2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td id="cell-3-0">&nbsp;</td>
<td id="cell-3-1">&nbsp;</td>
<td id="cell-3-2">
<div id="footer">
<!-- Footer -->
<div id="site-footer">
<a href="http://cxf.apache.org/privacy-policy.html">Privacy Policy</a> -
(<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=67744">edit page</a>)
(<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=67744&amp;showComments=true&amp;showCommentArea=true#addcomment">add comment</a>)<br>
Apache CXF, CXF, Apache, the Apache feather logo are trademarks of The Apache Software Foundation.<br>
All other marks mentioned may be trademarks or registered trademarks of their respective owners.
</div>
<!-- Footer -->
</div>
</td>
<td id="cell-3-3">&nbsp;</td>
<td id="cell-3-4">&nbsp;</td>
</tr>
<tr>
<td id="cell-4-0" colspan="2">&nbsp;</td>
<td id="cell-4-1">&nbsp;</td>
<td id="cell-4-2" colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4458903-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>