EJB CICS sample application task guide: Deployment
sgd040
We assume that you have:
The default applicationserver_root is /usr/lpp/WebSphere. Assuming this was used during installation of WAS, the directives for the CICS Sample application are:
ServerInit /usr/lpp/WebSphere/AppServer/bin/was350plugin.so:init_exit/usr/lpp/WebSphere,/demos/was.conf
Service /cicssample/* /usr/lpp/WebSphere/AppServer/bin/was350plugin.so: service_exit
ServerTerm /usr/lpp/WebSphere/AppServer/bin/was350plugin.so: term_exit
PATH=/bin:.:/usr/sbin:/usr/lpp/internet/bin:/usr/lpp/internet/sbin:/usr/lpp/ldap bin:/usr/lpp/java130s/IBM/J1.3/bin: /usr/lpp/ctg/bin:/usr/lpp/ffsserver/ bin: /usr/lpp/ffsserver/bin:/usr/lpp/db2/db2610/bin SHELL=/bin/sh TZ=EST5EDT LANG=C LC_ALL=en_US.IBM-1047 NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lpp/internet/%L/%N:/usr/lpp/ldap/lib/nls/msg /%L/%N
LIBPATH=/usr/lpp/internet/bin:/usr/lpp/internet/sbin:/usr/lpp/ldap/lib:
CLASSPATH=.:/usr/lpp/internet/server_root/CAServlet:/usr/lpp/java130s/IBM/J1.3/lib /classes.zip
DFHJVSYSTEM_00="CICSC021-C021CICS TS 2.1 region"
FFSPATH=/usr/lpp/ffsserver/bin |
Note: In this example, the PATH, LIBPATH, NLSPATH and CLASSPATH statements are split for printing purposes. In the actual httpd.conf file each statement is on a single line. |
Note: You may already have a number of jar files specified on your appserver classpath in which case you just need to add the j2ee.jar entry to it.
deployedwebapp.cicssample.host=default_host
deployedwebapp.cicssample.rooturi=/cicssample
deployedwebapp.cicssample.documentroot=/usr/lpp/WebSphere/AppServer/hosts
/default_host/cicssample/web
deployedwebapp.cicssample.classpath=
/usr/lpp/WebSphere/AppServer/hosts/default_host/cicssample/servlets:
/usr/lpp/WebSphere/AppServer/hosts/default_host/cicssample/servlets/SampleCLI.jar:
/usr/lpp/WebSphere/AppServer/hosts/default_host/cicssample/servlets/cics/sample
/SampleServlet.class
webapp.cicssample.jspmapping=*.jsp
webapp.cicssample.jsplevel=1.0
webapp.cicssample.filemapping=*.html
webapp.cicssample.filemapping=*.gif
webapp.cicssample.filemapping=*.jpg
webapp.cicssample.servlet.SampleServlet.autostart=true
webapp.cicssample.servlet.SampleServlet.servletmapping=/SampleServlet
webapp.cicssample.servlet.SampleServlet.code=cics.sample.SampleServlet
Note: In this example, the documentroot and classpath statements are split for printing purposes. In the actual was.conf file each statement is on a single line.
deployedwebapp.cicssample.host specifies the administrative name of the virtual host in which a Web application is deployed.
deployedwebapp.cicssample.rooturi provides the pattern by which a Web application is known within its virtual host. The CICSSample Web application in this case would then be the target for resources with the following URL: your_MVS_host:port_num/cicssample/index.html.
deployedwebapp.cicssample.documentroot specifies the fully qualified name of the directory root in the file system that contains the files associated with the Web application, such as JSPs, HTML and static files that are to be served by the Web application. The Application Server uses the directory specified on this property to locate a Web component of the specified type. Because the Application Server attempts to access JSPs, HTML and static files using the identity of the hosting Web server's process, your web server requires permission for read access to any information on how Web component requests are resolved to a physical resource.
deployedwebapp.cicssample.classpath specifies the classpath that the application level class loader searches for a servlet when the system class loader cannot find it. When the Application Server needs to load a servlet, it first attempts to load using a system class loader, which is configured to search the classpath defined in the appserver.classpath property.
webapp.cicssample.jspmapping specifies a URI pattern that, within the web application, resolves to a file that contains a jsp.
webapp.cicssample.jsplevel specifies the level of JSP processor to be configured for this application. The JSPs supplied with the EJB CICS Sample application, require the JSP processor to be at level 1.0.
webapp.cicssample.filemapping specifies a URI-patttern that maps to static content such as html, gifs and jpegs that are to be served within this web application.
webapp.cicssample.servlet.SampleServlet.autostart indicates whether the servlet should be loaded and its init method driven, whenever the Application Ser ver starts.
webapp.cicssample.servlet.SampleServlet.servletmapping specifies the path of the servlet, relative to the root URI. The servlet name, in this case SampleServlet is the servlet being invoked. After setting up the servletmapping, you can connect to the servlet by entering the URI-pattern /SampleServlet following the web applications root URI which is /cicssample.
webapp.cicssample.servlet.SampleServlet.code specifies the unique name of the servlet. This is essentially the package name of the servlet code.
/usr/lpp/WebSphere/AppServer/hosts/default_host/cicssample /usr/lpp/WebSphere/AppServer/hosts/default_host/cicssample/servlets /usr/lpp/WebSphere/AppServer/hosts/default_host/cicssample/web /usr/lpp/WebSphere/AppServer/hosts/default_host/cicssample/servlets/cics/sample
<?xml version="1.0"?> <servlet> <page-list> <default-page> <uri>/cicssample/SampleResults.jsp</uri> </default-page> <error-page> <uri>/cicssample/SampleError.jsp</uri> </error-page> </page-list> <code>cics.sample.SampleServlet</code> </servlet> |
<! * index.html CICS EJB Sample HTML page * * DATE: 2000/08/18 * VERSION: 1.0 * * This HTML form is the user front end for the CICS EJB sample. It takes a customer number and * Naming Service parameters and passes them to the SampleServlet. * * On installation of the sample, the nameService, providerURL and jndiName values should be * changed to match your JNDI Name Server setup. <HTML> <TITLE>CICS EJB Sample</TITLE> <BODY background="BankOfEcommerce.gif"> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center">CICS EJB Sample</H1> <FORM METHOD="post" ACTION="/cicssample/sample"> <P align="center">Enter a customer number between 1 and 5, edit the JNDI Name Server details as required, then click on Submit.</P> <div align="center"> <TABLE border="0"> <TR> <TD>Customer Number</TD> <TD> <INPUT TYPE="text" NAME="customerNumber" ID="customerNumber" value="1" SIZE="20" MAXLENGTH="20" > </TD> </TR> <TR> <TD>Name Service:</TD> <TD> <INPUT TYPE="text" NAME="nameService" ID="nameService" value="com.ibm.ejs.ns.jndi.CNInitialContextFactory" SIZE="50"> </TD> </TR> <TR> <TD>Provider URL:</TD> <TD> <INPUT TYPE="text" NAME="providerURL" ID="providerURL" value="iiop://adsjndi.hursley.ibm.com:900" SIZE="50"> </TD> </TR> <TR> <TD>JNDI Name:</TD> <TD> <input type="text" name="jndiName" id="jndiName" value="ASG/CICSSample" size="20"> </TD> </TR> <TR> <TD> </TD> <TD> <p> </p> <p> <input type="submit" name="Submit" id="Submit" value="Submit"> <input type="reset" name="Reset" id="Reset" value="Reset"> </p> </TD> </TR> </TABLE> </div> <P align="center"> </P> </FORM> </BODY> </HTML> |
<HTML> <HEAD><TITLE>CICS EJB Sample Error</TITLE></HEAD> <BODY background="BankOfEcommerce.gif"> <jsp:useBean id="ed" scope="request" class="cics.sample.ErrorData" /> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center">CICS EJB Sample Error</H1> <div align="center"> <TABLE border="1"> <TR> <TD>Error data:</TD> <TD><%=ed.getMessage() %></TD> </TR> </TABLE> </div> </BODY> </HTML> |
<HTML> <HEAD><TITLE>CICS EJB Sample Results</TITLE></HEAD> <BODY background="BankOfEcommerce.gif"> <jsp:useBean id="theCustomer" scope="request" class="cics.sample.CustomerData" /> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center"> </H1> <H1 align="center">Sample Account Query Result</H1> <div align="center"> <TABLE border="1"> <TR> <TD>Customer Number:</TD> <TD><% out.print(new Integer(theCustomer.getCustNo()).toString()); %></TD> </TR> <TR> <TD>First Name:</TD> <TD><%=theCustomer.getFirstName() %></TD> </TR> <TR> <TD>Last Name:</TD> <TD><%=theCustomer.getLastName() %></TD> </TR> <TR> <TD>Address:</TD> <TD><%=theCustomer.getAddress() %></TD> </TR> <TR> <TD>City:</TD> <TD><%=theCustomer.getCity() %></TD> </TR> <TR> <TD>State:</TD> <TD><%=theCustomer.getState() %></TD> </TR> <TR> <TD>Country:</TD> <TD><%=theCustomer.getCountry() %></TD> </TR> <TR> <TD>Account Number:</TD> <TD><% out.print(new Integer(theCustomer.getAcctNo()).toString()); %></TD> </TR> <TR> <TD>Balance:</TD> <TD><% out.print(new Double(theCustomer.getBalance()).toString()); %></TD> </TR> </TABLE> </div> </BODY> </HTML> |
Note: You can choose to use a directory structure more suitable for your OS/390 HFS environment as long as you ensure this is reflected in the Web application definition within your was.conf file.
You should also browse the WebSphere logs directory to ensure that the cicssample web application initialisation was completed successfully. The location of the WebSphere Application Server logs directory is specified using the property appserver.logdirectory in your was.conf file.
Http://host:portnum/cicssample/index.html
Where,
host is the IP address or DNS name of your OS/390 system
portnum is the Port Number your HTTP Server is configured to listen on.