getting started with websphere application server for...

34
Getting Started with WebSphere Application Server for AS/400 IBM

Upload: others

Post on 17-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Getting Started with WebSphereApplication Server for AS/400

IBM

Page 2: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page
Page 3: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Getting Started with WebSphereApplication Server for AS/400

IBM

Page 4: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

© Copyright International Business Machines Corporation 1998, 1999. All rights reserved.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.

Page 5: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Contents

Setting up WebSphere Application Server . . . . . . . . . . . . . . . . . . . . . . . 1What is WebSphere Application Server? . . . . . . . . . . . . . . . . . . . . . . . . 1

WebSphere Application Server and IBM HTTP Server for AS/400 . . . . . . . . . . . . . . 2Servlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2JavaServer Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Connection Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3WebSphere Application Server Manager . . . . . . . . . . . . . . . . . . . . . . . 3Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

What’s new in Version 2.02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Installing WebSphere Application Server . . . . . . . . . . . . . . . . . . . . . . . . 4

Requirements for WebSphere Application Server . . . . . . . . . . . . . . . . . . . . 5Backing up WebSphere Application Server 1.1 files . . . . . . . . . . . . . . . . . . . 6Stopping the IBM HTTP Server for AS/400 server instance. . . . . . . . . . . . . . . . . 8Installing the WebSphere Application Server product . . . . . . . . . . . . . . . . . . . 9Configuring IBM HTTP Server for AS/400 . . . . . . . . . . . . . . . . . . . . . . 10Starting WebSphere Application Server . . . . . . . . . . . . . . . . . . . . . . . 12Verifying the installation of WebSphere Application Server . . . . . . . . . . . . . . . . 12Completing the migration from version 1.1 to version 2.02 . . . . . . . . . . . . . . . . 13

Customizing and managing WebSphere Application Server settings . . . . . . . . . . . . . . 15Running sample servlets and Web applications . . . . . . . . . . . . . . . . . . . . . 15

Viewing the samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Running the non-database samples. . . . . . . . . . . . . . . . . . . . . . . . . 16Running the database samples . . . . . . . . . . . . . . . . . . . . . . . . . . 17Using the Site Activity Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Troubleshooting WebSphere Application Server . . . . . . . . . . . . . . . . . . . . . 21Common servlet problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Checking WebSphere Application Server logs for troubleshooting information . . . . . . . . . 22

Getting support for WebSphere Application Server for AS/400 . . . . . . . . . . . . . . . . 24Getting fixes for IBM WebSphere Application Server for AS/400 . . . . . . . . . . . . . . 24

Other resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24AS/400-specific resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Other IBM resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Java resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

© Copyright IBM Corp. 1998, 1999 iii

Page 6: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

iv Getting Started with WebSphere Application Server for AS/400

Page 7: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Setting up WebSphere Application Server

This topic provides information about the installation and configuration of the WebSphere ApplicationServer product.

If you are upgrading from WebSphere Application Server 1.1, see what’s new for version 2.02.

To get started with WebSphere Application Server, see the topics below:

Install WebSphere Application ServerThis topic gives you step-by-step instructions on how to install WebSphere Application Server,including prerequisites and setting up the IBM HTTP Server for use with WebSphere ApplicationServer.

Customize and manage WebSphere Application Server settingsUse WebSphere Application Server Manager, a browser-based graphical interface for WebSphereApplication Server settings, to customize your WebSphere Application Server settings, set upsecurity, manage the server, and monitor resources, connections, and logs.

Set up the samplesSeveral explanatory samples are included with WebSphere Application Server product—featuringservlets, JavaServer Pages (JSP), Extensible Markup Language (XML), and database access.Before you can run the samples, you must perform some steps to set them up.

If you need more help with WebSphere Application Server, see the following topics for more information:

Troubleshoot WebSphere Application ServerHaving problems with WebSphere Application Server? See this topic for diagnostic andtroubleshooting tips.

Get support for WebSphere Application ServerSee this topic for information about service and support information for WebSphere ApplicationServer for AS/400.

Other resourcesThis topic features links to other resources that will help you use WebSphere Application Server.

[ Legal ][ Copyright and Trademark ][ Feedback ]

What is WebSphere Application Server?

WebSphere Application Server is IBM’s Java-based Web application deployment environment forserver-side applications and JavaBeans. It helps customers deploy and manage Web-based applicationsranging from simple Web sites to powerful e-business solutions.

The Standard Edition focuses on a servlet runtime engine, high-performance database connections, andapplication services for session and state management. WebSphere Application Server helps solve reale-business problems today by offering a portable Java-based execution and management environment forserver-side critical business logic while enabling powerful Web transactions. These business applicationsand reusable components that Web-enable enterprise systems can be deployed in the environmentprovided by WebSphere Application Server.

The WebSphere Application Server componentry is illustrated by a multi-tiered architecture or networktopology with the WebSphere Application Server and IBM HTTP Server for AS/400 residing within thelogical middle-tier along with a collection of middleware components and services.

WebSphere Application Server features the following components and services:

© Copyright IBM Corp. 1998, 1999 1

Page 8: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

v Plug-in for IBM HTTP Server for AS/400 (page 1).

v Support for servlets (page 1), including:

– Java-based servlet engine.

– Implementation of the JavaSoft Java Servlet API

– IBM extensions and additions to the Servlet API.

v JavaServer Pages (JSP) support (page 2).

v XML Document Structure Services (page 2).

v Connection management feature (page 3) that caches and reuses JDBC connections.

v WebSphere Application Server Manager (page 3), the graphical administration interface for WebSphereApplication Server.

v Sample applications (page 3) demonstrating the basic servlet classes and IBM extensions.

WebSphere Application Server and IBM HTTP Server for AS/400

The IBM HTTP Server for AS/400 handles static content, CGI (Common Gateway Interface) programinvocations, and proprietary plug-ins. The runtime environment (WebSphere Application Server) plugs intoIBM HTTP Server for AS/400 via plug-in application programming interfaces (APIs), and then routesservlet requests to the servlet manager which then takes care of handling the request and passing thedata back to the client.

Servlets

Within the middle-tier and the Web Application Server environment, the focus is on the Servlet Enginewhich is Java-based. The servlet runtime provides the Sun/JavaSoft APIs for the Java servlet environment,including the servlet life cycle: init, service, destroy. Servlets can be preloaded, so that when a clientrequest comes in, a servlet is loaded and waiting to act on it.

Servlets send and receive most of their data through output and input streams. These streams aresupplied each time a servlet is invoked using the service callback. A popular specialization of servletsprovides function designed to make it easy to read parameters from a URL and send HTTP output inresponse to that URL request.

The servlet manager (part of WebSphere Application Server Manager) creates instances of the servlets,deploys them, manages their execution, and provides tracing and monitoring facilities for them. Servletsthemselves handle HTTP requests, maintain an HTTP session with the client, produce presentation logicvia HTML, stream and non-transactional business logic. Servlets can also call componentized functions orroutines built as JavaBeans. These beans can be called to connect to or interface with remote systems ofvarious types and formats using different native APIs.

WebSphere Application Server implements the Sun Microsystems Java Servlets Specification 2.0.

JavaServer Pages

The WebSphere Application Server servlet engine also handles requests for JavaServer Pages (JSP) orserver-side HTML scripting. These dynamic requests are normally not as “short-lived” as static ones.Therefore, the limit of how many concurrent requests this engine can handle is smaller than for staticserving, and the response time is longer. This is to be expected, since we are now running applicationsand dynamic content, and not just sending static bytes back to the client.

WebSphere Application Server implements the Sun Microsystems JavaServer Pages Specification 0.91.

2 Getting Started with WebSphere Application Server for AS/400

Page 9: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

XML

WebSphere Application Server supports XML document structures and can generate, validate, parse, andserve XML content.

WebSphere Application Server implements the W3C XML Specification 1.0.

Connection Manager

The Connection Manager manages a pool of relational database connections. Coupled with some dataaccess JavaBeans, the Connection Manager connects to a remote database, pulls in required data andsaves it into a local cache, and disconnects. The JavaBeans then work with the data in the cache indynamically generating web content.

WebSphere Application Server Manager

WebSphere Application Server Manager is a browser-based graphical interface that allows you to changeWebSphere Application Server settings and to configure and monitor Java resources, WebSphereApplication Server security, JDBC connections, active sessions, and logs.

After installing WebSphere Application Server, you can locate the Manager by directing your browser tothe following URL:

http://your.server.name:9090

where your.server.name is the host name of your Web server.

Samples

WebSphere Application Server includes sample servlets and Web site applications. These demonstrateboth simple techniques for request and response processing and more advanced techniques for providingdynamic data on JavaServer Pages. These include database access and the use of JavaBeans for routinetasks such as maintaining session information and authenticating users.

After installing WebSphere Application Server, you can locate the Samples by directing your browser to thefollowing URL:

http://your.server.name/IBMWebAS/samples/index.html

where your.server.name is the host name of your Web server.

[ Legal ][ Copyright and Trademark ][ Feedback ]

What’s new in Version 2.02

WebSphere Application Server Standard Edition for AS/400, Version 2.02, supports the following newfeatures:

v A new and improved graphical interface, WebSphere Application Server Manager. For more information,see WebSphere Application Server Manager help.

v Support for running WebSphere Application Server either in process with IBM HTTP Server for AS/400or as a stand-alone product. For more information, see In-process mode or stand-alone (out-of-process)mode.

v XML Document Structure Services, which consist of a document parser, a document validator, and adocument generator for server-side XML processing. For more information, see XML features inWebSphere Application Server.

Setting up WebSphere Application Server 3

Page 10: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

v New sample applications, including samples that demonstrate WebSphere Application Server XMLservices. For more information, see WebSphere Application Server samples.

v A simplified Application Server Classpath. In version 1.x, you had to specify the WebSphere ApplicationServer JAR files in the Application Server Classpath. In version 2.02, WebSphere Application Serverautomatically searches the /QIBM/ProdData/IBMWebAS/lib directory for the necessary JAR files. Thisdirectory search feature applies to other JAR and ZIP files you might add to the classpath: you nolonger need to specify each individual JAR or ZIP file—just the directory in which the file resides.

This version no longer supports the following version 1.x features:

v Common Object Request Broker Architecture (CORBA).

v URL rewriting from JavaServer Pages to preserve session state. URL rewriting, however, is supportedfrom servlets. For more information, see Session state without cookies.

WebSphere Application Server for AS/400 differs from WebSphere Application Server for other platforms:

v WebSphere Application Server Manager is available, by default, on port 9090. (The default port on otherplatforms has changed to 9527.)

[ Legal ][ Copyright and Trademark ][ Feedback ]

Installing WebSphere Application Server

WebSphere Application Server 2.02 Standard Edition for AS/400 is available for OS/400 version 4 release4 through what is known as a PTF installation. Although PTFs are frequently associated with code fixes orpatches PTF installations make it possible to add new functions between operating system releases.

Note: This product has undergone the same testing procedures that are used on other licensedprograms.

Before you install the PTF package that comprises this product, please read through the steps below:

1. Check the prerequisite requirements for WebSphere Application Server.

2. Back up version 1.1 files. If you are currently using WebSphere Application Server 1.1 for AS/400,follow these steps to back up version 1.1. If you are new to WebSphere Application Server, you canskip this step.

3. Stop your IBM HTTP Server for AS/400 server instance. If you have a previously-created IBM HTTPServer for AS/400 server instance that you will be using to run WebSphere Application Server 2.02,stop the instance before installing the PTFs.

4. Install the product PTF package.

5. Configure an IBM HTTP Server for AS/400 server instance to support WebSphere Application Server.This topic also shows how to reconfigure a previously-created server instance to support WebSphereApplication Server.

6. Start WebSphere Application Server by starting your IBM HTTP Server instance.

7. Verify the installation.

8. Complete your migration steps.

For the latest news and information about WebSphere Application Server for AS/400, see our product

home page at http://www.as400.ibm.com/websphere

[ Legal ][ Copyright and Trademark ][ Feedback ]

4 Getting Started with WebSphere Application Server for AS/400

Page 11: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Requirements for WebSphere Application Server

Use the command GO LICPGM to make sure that the following software is installed on your AS/400system:

v Operating System/400, version 4, release 4 (5769-SS1)

v IBM HTTP Server for AS/400 (5769-DG1)

v WebSphere Application Server for AS/400 (5769-AS1)

v AS/400 Developer Kit for Java (5769-JV1)

v Qshell Interpreter (5769-SS1 - Option 30)

v The most current cumulative program temporary fix (PTF) package. (To get the most recent cumulativepackage for V4R4, order PTF number SF99440).

Note: WebSphere Application Server ships with a browser-based administration interface, the WebSphereApplication Server Manager. To view the Manager from a client workstation, you need a Java-enabledbrowser, such as:

v Netscape Navigator 4.06 or higher.

v Microsoft Internet Explorer 4.01 (with Service Pack 1) or higher.

[ Legal ][ Copyright and Trademark ][ Feedback ]

IBM HTTP Server for AS/400

WebSphere Application Server works in conjunction with your web server. Currently, WebSphereApplication Server for AS/400 only supports the IBM HTTP Server for AS/400 web server.

For more information on setting up the IBM HTTP Server for AS/400, see “Web serving with your IBM

HTTP Server” in the AS/400 Information Centerat http://www.as400.ibm.com/infocenter (Clicking thislink will open a new browser session.)

[ Legal ][ Copyright and Trademark ][ Feedback ]

WebSphere Application Server for AS/400

WebSphere Application Server 1.1 ships with OS/400 V4R4. WebSphere Application Server 2.02 buildsupon Version 1.1, so Version 1.1 must be installed prior to installing Version 2.02.

If you have previously installed and configured WebSphere Application Server 1.1, please see the Back upWebSphere Application Server 1.1 files section for steps you should take to preserve your currentWebSphere Application Server settings. After installing the 2.02 product, see the Complete the migrationfrom version 1.1 to version 2.02 topic.

For more information about WebSphere Application Server 1.1 for AS/400, see Getting Started with IBMWebSphere Application Server 1.1 for AS/400at

http://www.as400.ibm.com/tstudio/websphere/docs/wasgs44.htm (Clicking this link will open a newbrowser session.)

[ Legal ][ Copyright and Trademark ][ Feedback ]

AS/400 Developer Kit for Java

AS/400 Developer Kit for Java provides the Java virtual machine for WebSphere Application Server as wellas the Java utilities you need to develop servlets and JavaServer Pages (JSP).

Setting up WebSphere Application Server 5

Page 12: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

For V4R4, you can install two different versions of AS/400 Developer Kit for Java, equivalent to JavaSoft’sJava Development Kit (JDK) 1.1.6 or 1.1.7. WebSphere Application Sever supports both. Install one orboth version. When both 1.1.6 and 1.1.7 are installed, 1.1.7 acts as the default, since it is the most recentversion installed.

Note: AS/400 Developer Kit for Java on V4R4 will provide support for JDK levels 1.1.8 and 1.2through a PTF package. WebSphere Application Server supports JDK level 1.1.8. However,WebSphere Application Server does not support the JDK level 1.2 of AS/400 Developer Kit for Java.

For more information about installing AS/400 Developer Kit for Java and multiple JDK versions, see theAS/400 Developer Kit for Java referenceat

http://publib.boulder.ibm.com/pubs/html/as400/v4r4/ic2924/info/java/rzaha/devkit.htm. (Clicking this linkopens a new browser session.)

[ Legal ][ Copyright and Trademark ][ Feedback ]

Qshell Interpreter

Qshell Interpreter is a command environment (or shell) similar to the UNIX Korn shell. With QshellInterpreter, you can use the standard Java commands (such as java , javac , and rmiregistry ) on AS/400.

While WebSphere Application Server does not directly utilize Qshell Interpreter, you will find it a valuabletool for the development of servlets. Step-by-step instructions for using Qshell Interpreter appear in theServlets section of this document.

For more information about Qshell Interpreter, see the Qshell Interpreter referenceat

http://publib.boulder.ibm.com/pubs/html/as400/v4r4/ic2924/info/java/rzahz/qshell.htm (Clicking this linkwill open a new browser session.)

[ Legal ][ Copyright and Trademark ][ Feedback ]

Backing up WebSphere Application Server 1.1 files

WebSphere Application Server 2.02 installs upon the WebSphere Application Server 1.1 (5769-AS1) base.

While files you have added to WebSphere Application Server directory structure(/QIBM/ProdData/IBMWebAS) remain unaffected by the 2.02 installation, we recommend that you back upthese files.

You may also want to backup any properties files you have changed.

During the WebSphere Application Server 2.02 installation process, only new properties files or propertiesfiles that have changed will be added. If a properties file has changed between version 1.1 and version2.02, the installation process will create a backup file (with the extension .bak) of the 1.1 property file. Forinstance, the version 1.1 servlets.properties file will become the 2.02 servlets.properties.bak file.

The table below lists the version 2.02 files that will be added to the version 1.1 directory structure:

Directory in /QIBM/ProdData/IBMWebAS Files

properties/ version.properties (new)

bootstrap.properties (new, replaces jvm.properties)

properties/server/servlet debug.properties (changed)

server.properties (changed)

6 Getting Started with WebSphere Application Server for AS/400

Page 13: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Directory in /QIBM/ProdData/IBMWebAS Files

properties/server/servlet/adminservice doc.properties (changed)

mime.properties (changed)

/properties/server/servlet/servletservice adminUI.properties (changed)

directory.properties (new)

endpoint.properties (changed)

mime.properties (changed)

service.properties (changed)

servlets.properties (changed)

userprofile.properties (changed)

Some 1.1 properties values will be automatically migrated into the 2.02 properties files. The table belowshows these properties:

Property file 1.1 property 2.02 property

jvm.properties ncf.jvm.classpath java.classpath (inbootstrap.properties)

ncf.jvm.use.system.classpath java.use.system.classpath (inbootstrap.properties)

servlets.properties servlets.classpath servlets.classpath

Note: All servlets that you haveadded using the WebSphereApplication Server 1.1 graphicalinterface will be migrated to version2.02.

Although your changes will be backed up or migrated during the installation process, we recommend thatyou make a backup copy of the properties files you have changed.

Carefully examine your WebSphere Application Server 1.1 directory structure for any changed or addedfiles to determine which files are necessary to save. Copy the files to a directory outside the WebSphereApplication Server directory structure (/QIBM/ProdData/IBMWebAS).

[ Legal ][ Copyright and Trademark ][ Feedback ]

Copying WebSphere Application Server 1.1 files

We recommend that you preserve the directory structure when you copy your files. For instance, if you arebacking up your files from the /QIBM/ProdData/IBMWebAS/servlets directory to a directory called /backup,create a servlets subdirectory—/backup/servlets—and copy your files to /backup/servlets. If, for somereason, you need to copy the files back into the product directory structure, you will easily be able to tell inwhich directory each file belongs.

If you are copying your files from the AS/400 command line with the CPY (copy) command, make sure youcreate the appropriate subdirectories in your destination directory with the CRTDIR command.

Here are some AS/400 command examples you may find helpful:

v CRTDIR DIR(’/backup’) - This command creates a directory called backup.

v CRTDIR DIR(’/backup/classes’) - This command creates a subdirectory called classes in the backupdirectory.

Setting up WebSphere Application Server 7

Page 14: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

v CPY OBJ(’/QIBM/ProdData/IBMWebAS/classes/MyClass.class’) TODIR(’/backup/classes’) - Thiscommand copies a file, MyClass.class, from the WebSphere Application Server directory structure tothe /backup/classes subdirectory.

v CPY OBJ(’/QIBM/ProdData/IBMWebAS/classes/*’) TODIR(’/backup/classes’) - This command copies thecontents of WebSphere Application Server classes directory to the /backup/classes subdirectory.

Note: If the /QIBM/ProdData/IBMWebAS/classes directory has any subdirectories, the contents ofthose subdirectories will not be copied, and you will receive an error message. However, the filesin the classes directory should successfully be copied.

If you are experienced in creating and restoring AS/400 Save Files (SAVF), you can back up your 1.1 filesand directories in that way. If, for some reason, you need to restore files to the product directory structure,be careful that you do not accidentally overwrite files in the 2.02 directory structure.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Stopping the IBM HTTP Server for AS/400 server instance

You can reconfigure a previously-created server instance to run WebSphere Application Server for AS/400.However, before you install the product PTFs, you must stop your instance.

Note: If you are planning to create a new server instance to run WebSphere Application Server, youcan skip this step.

To stop your server instance from the IBM HTTP Server for AS/400 Configuration and Administrationforms:

1. Start the ADMIN server.

2. Open the Configuration and Administration forms.

3. On the IBM HTTP Server for AS/400 Configuration and Administration menu, click Server instances .

4. Click Work with server instances .

5. In the Server instance pull-down menu, select your server instance.

6. Stop the server instance by clicking the Stop button.

A message appears, stating The server instance was successfully stopped.

To stop your server instance from the AS/400 command line:

v On the AS/400 command line, type:

ENDTCPSVR SERVER(*HTTP) HTTPSVR(yourInstance)

where yourInstance is the name of your server instance.

Press the Enter key.

A message stating HTTP server ended appears.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Starting the ADMIN instance of IBM HTTP Server for AS/400

To create, change, or display a server instance configuration, use the IBM HTTP Server for AS/400Configuration and Administration forms. To use the forms, you must start the *ADMIN instance of theHTTP Server.

There are two methods you can use to start the ADMIN server instance:

From Operations Navigator: Operations Navigator is the graphical point-and-click interface to theAS/400 system. Operations Navigator is part of the AS/400 Client Access product.

8 Getting Started with WebSphere Application Server for AS/400

Page 15: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Note:For more information on Client Access and Operations Navigator, see the Client Access home

page at http://www.as400.ibm.com/clientaccess/ (Clicking on this link opens a new browsersession.)

1. Start Operations Navigator.

2. Double-click your AS/400 server in the main tree view of Operations Navigator.

3. Double-click Network .

4. Double-click Servers .

5. Double-click TCP/IP.

6. Right-click HTTP Administration .

7. Select Start from the pop-up menu.

From the AS/400 command line: On the AS/400 command line, type:

STRTCPSVR SERVER(*HTTP) HTTPSERVER(*ADMIN)

and press the Enter key.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Opening the IBM HTTP Server Configuration and Administration forms

The IBM HTTP Server for AS/400 Configuration and Administration forms are a browser-based graphicalinterface that allows you to configure and manage the IBM HTTP Server for AS/400 product.

To open the Configuration and Administration forms:

1. Start your JavaScript-enabled browser.

2. In the URL location or address window, type:

http:// your.server.name:2001

where your.server.name is the domain name or IP address of your AS/400 server.

Press the Enter key.

The AS/400 Tasks page appears.

3. Click IBM HTTP Server for AS/400 .

The IBM HTTP Server for AS/400 page appears.

4. In the left pane, click Configuration and Administration .

The IBM HTTP Server for AS/400 Configuration and Administration page appears.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Installing the WebSphere Application Server product

WebSphere Application Server 2.02 for AS/400 is available through a group PTF (program temporary fix).Make sure you specify Group PTF SF99027 when ordering.

You can order PTFs from a variety of sources. See the AS/400 Technical Support site at

http://as400service.rochester.ibm.com (Clicking on this link will open a new browser session.) In thenavigation menu, click “Fixes, Drivers and Updates” and then “PTF Ordering.”

Follow the instructions in the PTF cover letters that are shipped with the fixes.

Setting up WebSphere Application Server 9

Page 16: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

For more information about applying PTFs, see “What are PTFs and Why Do I Need Them?” in theAS/400 Basic System Operation, Administration, and Problem Handlingreference at

http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/QB3AGO03/4.5 (Clicking this link opens anew browser session.)

[ Legal ][ Copyright and Trademark ][ Feedback ]

Configuring IBM HTTP Server for AS/400

Configure an instance of your IBM HTTP Server for AS/400 to run WebSphere Application Server 2.02.

Note:For more information about setting up TCP/IP and IBM HTTP Server for AS/400, see “Web

Serving with your IBM HTTP Server” at http://www.as400.ibm.com/infocenter . (Clicking on thislink will start a new browser session.)

To configure an IBM HTTP Server instance for WebSphere Application Server, follow these steps:

1. Start the ADMIN instance of IBM HTTP Server for AS/400.

2. Open the IBM HTTP Server Configuration and Administration forms.

3. Create a new configuration file. If you are using a previously-created server instance to runWebSphere Application Server, you can skip this step.

4. Enable Java servlets in your configuration. If you are migrating from version 1.1, you must still followthis step. The server instance you have been using contains version 1.1 directives. Re-enabling Javaservlets in your configuration will add the version 2.02 directives to your server instance configuration.

5. Associate your new configuration with a server instance. If you are using a previously-created serverinstance to run WebSphere Application Server, you can skip this step.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Creating an IBM HTTP Server for AS/400 configuration file

Use the IBM HTTP Server for AS/400 Configuration and Administration forms to create the file thatconfigures your IBM HTTP Server instance.

To create your IBM HTTP Server configuration file, follow these steps:

1. In the left pane of the IBM HTTP Server for AS/400 Configuration and Administration page, clickCreate configuration under the Configurations heading.

2. Specify a configuration name in the Configuration text box.

We suggest that you click the radio button in front of Create based on existing configuration andselect a configuration file name.

Note: If you do not have an existing configuration file to use, select the default CONFIGconfiguration.

Click the Apply button.

A message stating The configuration file was successfully created appears.

3. The name of your new configuration file should appear in text box below Configurations in the leftpane. If it does not, select it from the pull-down menu.

Return to the previous page, “Configure the IBM HTTP Server for AS/400,” and continue with “EnableJava Servlets for your configuration.”

[ Legal ][ Copyright and Trademark ][ Feedback ]

10 Getting Started with WebSphere Application Server for AS/400

Page 17: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Enabling Java servlets for your configuration

Now that you have set up a basic IBM HTTP Server for AS/400 configuration, you must enable it for Javaservlets by using the HTTP Server Configuration and Administration forms. This action adds theconfiguration directives that are specific to WebSphere Application Server 2.02. These directives instructthe HTTP server to forward Java requests to WebSphere Application Server and set up the WebSphereApplication Server samples.

Note: If you are migrating from version 1.1, you must perform this step to configure your serverinstance to support WebSphere Application Server 2.02.

While you could manually edit your server instance configuration file to add the necessary directives, wedo not recommend that you do so. Server directives are case-sensitive, and manually editing them ishighly error-prone. Using the HTTP Server Configuration and Administration forms ensures that thedirectives with be automatically and correctly added to your configuration.

To enable your configuration for Java servlets:

1. Under Configurations in the left pane of the IBM HTTP Server for AS/400 Configuration andAdministration page, click Java Servlets .

2. Check both URL invocation and JavaServer Pages (JSP) . Click the Apply button.

This action adds to your configuration file the necessary WebSphere Application Server directives,listed below:Service /servlet/* /QSYS.LIB/QAPPSVR.LIB/QZHJSVLT.SRVPGM:AdapterServiceService /*.jsp /QSYS.LIB/QAPPSVR.LIB/QZHJSVLT.SRVPGM:AdapterServicePass /IBMWebAS/samples/* /QIBM/ProdData/IBMWebAS/samples/*Pass /IBMWebAS/* /QIBM/ProdData/IBMWebAS/web/*ServerInit /QSYS.LIB/QAPPSVR.LIB/QZHJSVLT.SRVPGM:AdapterInit /QIBM/ProdData/IBMWebAS/properties/bootstrap.propertiesServerTerm /QSYS.LIB/QAPPSVR.LIB/QZHJSVLT.SRVPGM:AdapterExit

Note: To verify that the directives were correctly added to your server instance configuration file,View your configuration file. If, for some reason, you must manually edit the configuration file, youcan do so by entering WRKHTTPCFG CFG(myconfig) from the AS/400 command line. Use thename of your server instance configuration in place of myconfig in the command.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Viewing your IBM HTTP Server for AS/400 configuration file:1. Start the ADMIN instance of IBM HTTP Server for AS/400.

2. Open the IBM HTTP Server Configuration and Administration forms.

3. In the navigation menu, click Configurations . Select the name of your server instance’s configurationfile from the pull-down menu.

Note: If you are not sure what the name of the configuration file is, use the forms to find out.Click Server instances . Click Change associated configuration . Find your server instance. Theassociated configuration listed next to it is the name of your configuration file.

4. Click Display configuration . The HTTP server configuration file will be displayed in the main pane.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Associating the configuration with a server instance

The next step is to associate your servlet-enabled configuration with an IBM HTTP Server instance.

If you do not have an existing instance with which to associate your configuration, create a new serverinstance.

Setting up WebSphere Application Server 11

Page 18: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

To associate your new configuration with an existing server instance, follow these steps:

1. On the IBM HTTP Server for AS/400 Configuration and Administration menu, click Server instance .

2. Click Change associated configuration .

3. Select your server instance from the Server instance pull-down menu. Select your new configurationfrom the Associated configuration pull-down menu.

Click the Apply button.

A message appears, stating that the associated configuration was successfully changed.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Creating an IBM HTTP Server for AS/400 instance:1. On the IBM HTTP Server for AS/400 Configuration and Administration menu, click Server instances .

2. Click Create server instance .

3. In the Create server instance page, type a name in the Server instance text box. From theConfiguration pull-down menu, select the configuration you created.

Click the Create button.

A message stating The server instance was successfully created appears.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Starting WebSphere Application Server

WebSphere Application Server runs in conjunction with your HTTP server instance, so to start WebSphereApplication Server, you need to start the server instance that runs WebSphere Application Server.

You can start your server instance from the IBM HTTP Server for AS/400 Configuration and Administrationforms or from the AS/400 command line.

From the IBM HTTP Server for AS/400 Configuration and Administration forms:

1. On the IBM HTTP Server for AS/400 Configuration and Administration menu, click Server instances .

2. Click Work with server instances .

3. In the Server instance pull-down menu, select your server instance.

4. Stop the server instance by clicking the Start button.

A message appears, stating The server instance was successfully started.

From the AS/400 command line:

v On the AS/400 command line, type:

STRTCPSVR SERVER(*HTTP) HTTPSVR(yourInstance)

where yourInstance is the name of your server instance.

Press the Enter key.

A message stating HTTP server starting appears.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Verifying the installation of WebSphere Application Server

You can verify if you have set up your WebSphere Application Server on AS/400 correctly by running oneof the servlets shipped on the system.

To run the HelloWorld servlet, follow these steps:

12 Getting Started with WebSphere Application Server for AS/400

Page 19: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

1. Start a browser on your workstation.

2. In the URL location box, type the following URL:

http:// your.server.name:xxxx/servlet/HelloWorldServlet

where your.servler.name:xxxx is your HTTP server name and the corresponding port number.

Note: If you did not specify a default port number in the configuration for your HTTP Serverinstance, then enter this URL:

http:// your.server.name/servlet/HelloWorldServlet

where your.server.name is your HTTP server name.

Press the Enter key.

If you see “Hello World” show up as the result, then your WebSphere Application Server is set up andready to go.

If “Hello World” did not appear, see our Troubleshooting section for advice.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Completing the migration from version 1.1 to version 2.02

After you have installed the group PTF package for WebSphere Application Server 2.02, check to makesure the files you added to the 1.1 directory structure have been unaffected by the installation process. Ifnecessary, migrate your backed up files to the /QIBM/ProdData/IBMWebAS directory structure.

Note: Do not migrate your backed up properties files into the product directory structure. Manyproperties files have changed between version 1.1 and version 2.02. If you overwrite version 2.02properties files with version 1.1 properties files, you will lose new functionality and possibly causeWebSphere Application Server 2.02 to no longer run properly.

The WebSphere Application Server 2.02 installation process automatically migrates threecommonly-customized version 1.1 properties to version 2.02: ncf.jvm.classpath (from jvm.properties),ncf.jvm.use.system.classpath (from jvm.properties), and servlets.classpath (from servlets.properties). If youhave customized any other version 1.1 properties, you will have to migrate those properties by hand.

Many of your 1.1 properties files were backed up during the 2.02 installation process. These backed upfiles have the file extension .bak. Do not rename the .bak files to replace 2.02 properties files, for instance,renaming servlet.properties.bak to servlet.properties. In this example, the 2.02 servlet.properties filecontains properties that the 1.1 version of servlet.properties does not contain. Replacing any 2.02properties files with a 1.1 property file will cause WebSphere Application Server to not work correctly.

To migrate your version 1.1 properties, you use one of two methods:

v Set the properties in the WebSphere Application Server Manager.

v Edit the 2.02 properties files with a text editor, inserting the desired property values.

Generally, it is a good idea to make properties changes through the Manager interface. The Managerinterface is easier to use. Editing properties files can be tedious and error-prone. However, someproperties that you have changed may not be not represented in the Manager interface. In this case,editing the properties files is acceptable.

Setting up WebSphere Application Server 13

Page 20: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

The table below will help you to determine which properties have changed from version 1.1 to version2.02. The last column describes where you can find a property in the 2.02 WebSphere Application ServerManager.

Note: For more information about WebSphere Application Server Manager, see WebSphereApplication Server help.

Note: In this table, N/A stands for “not applicable,” meaning the property is has been discontinued, the property isnot supported on the AS/400 system, or the property is not available from the WebSphere Application ServerManager.

Property description 1.1 property(jvm.properties)

2.02 property(bootstrap.properties)

Location in 2.02 Manager

Classpath for the Javavirtual machine

ncf.jvm.classpath java.classpath Setup -> Java Engine ->Paths -> Application ServerClasspath

A name for the service ncf.service.name service.name N/A

Enable service tracelogging

ncf.native.logison N/A N/A

The name of the servicetrace log

ncf.native.logfile N/A N/A

Enable standard out logging ncf.jvm.stdoutlog.enabled N/A N/A

Enable standard out loggingto a file

ncf.jvm.stdoutlog.file N/A N/A

Whether the systemclasspath is appended toApplication ServerClasspath.Recommended value: true

ncf.jvm.use.system.classpath java.use.system.classpath Setup -> Java Engine ->Paths -> Use SystemClasspath?

The location of the Javavirtual machine and userbinaries

ncf.jvm.path N/A N/A

Java virtual machinestarting heap size

ncf.jvm.ms java.ms Setup -> Java Engine ->Memory -> Starting HeapSize

Java interpreter maximumheap size

ncf.jvm.mx java.mx Setup -> Java Engine ->Memory -> Maximum HeapSize

One property (ncf.jvm.stdoutlog.filename) from the version 1.1 jvm.properties file is located in the version2.02 /QIBM/ProdData/IBMWebAS/properties/server/servlet/debug.properties file.

Note: The ncf.jvm.stdoutlog.filename property cannot be set from WebSphere Application ServerManager.

Property description 1.1 property(jvm.properties)

2.02 property(debug.properties)

Note

The file to hold the Javavirtual machine System.outerror output.

ncf.jvm.stdoutlog.filename debug.java.stdout.file Specify the file name only,not the path. The file will beplaced in the logs/directory.Default: jvm_stdout.log

[ Legal ][ Copyright and Trademark ][ Feedback ]

14 Getting Started with WebSphere Application Server for AS/400

Page 21: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Customizing and managing WebSphere Application Server settings

After you have installed the WebSphere Application Server product, you have the option to change thedefault settings. In most cases, only a few changes are necessary—for instance, if you want to add yourown Java classes and packages to the classpath, use a directory services product (such as AS/400Directory Services) to manage WebSphere Application Server, or set up special security settings.

To customize your WebSphere Application Server settings, use the WebSphere Application ServerManager, a browser-based graphical interface that allows you to change and administer WebSphereApplication Server settings. The Manager is located at the following URL:http://your.server.name:9090

where your.server.name is the host name of your Web server.

Note: For more information about customizing WebSphere Application Server settings, see theWebSphere Application Server Documentation Center. After you have installed WebSphereApplication Server, open /QIBM/ProdData/IBMWebAS/web/as400doc/index.html or point your browserto http://your.server.name/IBMWebAS/as400doc/index.html

[ Legal ][ Copyright and Trademark ][ Feedback ]

Running sample servlets and Web applications

WebSphere Application Server includes sample servlets and Web site applications. These demonstrateboth simple techniques for request and response processing and more advanced techniques for providingdynamic data on JavaServer Pages. These include database access and the use of JavaBeans for routinetasks such as maintaining session information and authenticating users.

See the following topics for information about setting up and running the WebSphere Application Serversamples:

v Viewing the samples

v Running the non-database samples (page 16)

– 16

– FormDisplayServlet (page 16)

– FormProcessingServlet (page 16)

– Site Outliner (page 17)

v Running the database samples

– IBMConnMgrTest

– XtremeAdventures (page 19)

– XtremeXML

– WebBank

– Hints and Tips for problem solving

v Using the Site Activity Monitor

Viewing the samples

Compiled copies of the samples are on your system and ready for use. You do not need to recompile thesamples unless you want to make changes. Before you use the samples that demonstrate databaseaccess, follow the instructions for preparing the database, as described in (L)Running the databasesamples(/L).

Setting up WebSphere Application Server 15

Page 22: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

For quick access to the samples, use your browser to open the samples index page:http://your.server.name/IBMWebAS/samples/index.html

where your.server.name is the host name of your Web server. The HTML files for a given sample are inthe samples directory, and the source code and related files are either in the samples directory or theservlets directory. Look for:/QIBM/ProdData/IBMWebAS/samples/sample_name/QIBM/ProdData/IBMWebAS/servlets/sample_name

where sample_name is the name of the sample, such as ReqInfoServlet.

Running the non-database samples

This section describes the samples that do not require a database.

ReqInfoServlet

This servlet extracts information about the servlet request and returns it to the client. This servlet does nothave HTML pages. To run the servlet, use either of the following methods:

v Use your browser to open the samples index page and select “Echo a request” from the Basic Servlets:

http://your.server.name/IBMWebAS/samples/index.html

v Use your browser to open the URL of the servlet:

http://your.server.name/servlet/ReqInfoServlet

FormDisplayServlet

This servlet reads input from an HTML form and returns it in a Web page. To run the servlet, use either ofthe following methods:

v Use your browser to open the samples index page and select “Display form input” from the BasicServlets:

http://your.server.name/IBMWebAS/samples/index.html

v Use your browser to open the URL of the servlet form:

http://your.server.name/IBMWebAS/samples/FormDisplayServlet/FormDisplayServletForm.html

FormProcessingServlet

This servlet reads and processes registration data from an HTML form, returns a customized page, andwrites registration data to a file.

1. To run the servlet, copy the seminar.txt file from the/QIBM/ProdData/IBMWebAS/samples/FormProcessingServlet directory to the HTML document rootdirectory on your Web server. This can be accomplished using the copy command:

CPY OBJ('/QIBM/ProdData/IBMWebAS/samples/FormProcessingServlet/seminar.txt')TODIR('/QIBM/ProdData/HTTP/Public/HTTPSVR/HTML/')

2. Now change the HTTP server instance configuration file documentation root pass statement. Theserver is shipped with the pass statement:

Pass /QIBM/ProdData/HTTP/Public/HTTPSVR/HTML/Welcome.html

This must be changed to the following and moved to the bottom of the Pass statements in your HTTPConfiguration file:

Pass /* /QIBM/ProdData/HTTP/Public/HTTPSVR/HTML/*

16 Getting Started with WebSphere Application Server for AS/400

Page 23: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Note: This new Pass statement will make all objects in the/QIBM/ProdData/HTTP/Public/HTTPSVR/HTML subdirectory accessible to the public, so the Webadministrator must ensure that secure documents are not placed in this subdirectory.

3. Grant the HTTP server’s user profile (QTMHHTTP) read access to the seminar.txt file using thefollowing command:

CHGAUT OBJ('/QIBM/ProdData/HTTP/Public/HTTPSVR/HTML/seminar.txt')USER(QTMHHTTP) DTAAUT(*RWX)

This servlet reads and processes registration data from an HTML form, returns a customized page andwrites registration data back to the seminar.txt file.

4. To run the sample, use either of the following methods:

v Use your browser to open the samples index page and select “Process form input” from the BasicServlets:http://your.server.name/IBMWebAS/samples/

v Use your browser to open the URL of the servlet form:http://your.server.name/IBMWebAS/samples/FormProcessingServlet/FormProcessingServletForm.html

When you are done, look at the seminar.txt file to verify your registration.

Site Outliner

The Site Outliner sample implements the WebSphere Application Server’s XML Document Structuresupport and creates a Channel Definition Format (CDF) file. To learn about XML, see the XML topic.

1. This sample application requires the ability to write information to the html root on your web server. Todo this, you need to give the QTMHHTTP user profile *RWX authority to/QIBM/ProdData/HTTP/Public/HTTPSVR/HTML. Since this is not recommended for long-term use,modify the application to write information elsewhere if you are interested in running this application inthe long term.

2. To enable the FormProcessingServlet, change the IBM HTTP Server for AS/400 instance configurationfile documentation root pass statement—if you have not already done so. The server is shipped withthe following pass statement:

Pass /QIBM/ProdData/HTTP/Public/HTTPSVR/HTML/Welcome.html

This must be changed to the following and moved to the bottom of the Pass statements in your HTTPConfiguration file:

Pass /* /QIBM/ProdData/HTTP/Public/HTTPSVR/HTML/*

Note: This new Pass statement will make all objects in the/QIBM/ProdData/HTTP/Public/HTTPSVR/HTML subdirectory accessible to the public, so the Webadministrator must ensure that secure documents are not placed in this subdirectory.

The Setting up a JavaServer Pages directory topic describes how to edit your server instanceconfiguration file. Use the process described in that topic to add the necessary Pass statement to yourconfiguration.

To run Site Outliner: Use your browser to open the URL of the sample’s HTML file:http://your.server.name/IBMWebAS/samples/SiteOutliner/SiteOutliner.html

Running the database samples

Some of the samples demonstrate database access. Before you can use these samples, complete theconfiguration steps below:

Setting up WebSphere Application Server 17

Page 24: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

1. If you would like your database samples to access the database via a specific userid and password,create a user profile on your AS/400 with a password. The userid and password values will be used insteps 2-4 below. Otherwise, you will access the databases using the web server’s QTMHHTTP userprofile.

2. Run the ConfigWAS202 Java program found in the /QIBM/ProdData/IBMWebAS/samples directory.See /QIBM/ProdData/IBMWebAS/samples/readme.txt for more details on the prerequisites, behavior,and execution of this command.

Warning: This program will drop and re-create the following collections on your AS400:CORPDATA, WEBBANK, and WBSPHERE. If you already have a database collection by any ofthese names on your system that is used for purposes other than WebSphere database samples,do not run this tool.

To run this Java program, execute the following commands on the AS/400 command line substitutingfor ’jt400_root’ the full path to the jt400.jar file on your AS/400; and for ’userProfile’ the user profilecreated in step 1 above:

CD '/qibm/proddata/ibmwebas/samples'RUNJVA CLASS(ConfigWAS202) PARM(all userProfile)

CLASSPATH('/qibm/proddata/ibmwebas/samples:jt400_root/jt400.jar')

Note: Instead of using ’all’ as the PARM, you can specify one database at a time to bettermonitor the status information output to the Java Shell Display. See/QIBM/ProdData/IBMWebAS/samples/readme.txt for more details on this parameter.

3. Edit the .servlet files for the XtremeAdventures and WebBank samples to give the applications accessto DB2. These are XML files that contain elements to specify the database, the driver, and the useridand password created in step 1 - if any. The userid and password values should be left as is unlessstep 1 above was done.

Look for these elements, change the values to your site-specific database values, and save the .servletfiles. (Note: Not all files will have all the elements or use the same initial values)

<init-parameter name=“URL” value=“jdbc:db2:sample”/><init-parameter name=“userID” value=“null”/><init-parameter name=“driver” value=“com.ibm.db2.jdbc.app.DB2Driver”/><init-parameter name=“password” value=“null”/>

a. For Xtreme Adventures, edit the file:

/QIBM/ProdData/IBMWebAS/servlets/XtremeTravel/FlightsServlet.servlet

b. For WebBank, edit all four of the .servlet files:

v /QIBM/ProdData/IBMWebAS/servlets/WebBank/SignonServlet.servlet

v /QIBM/ProdData/IBMWebAS/servlets/WebBank/RegistrationServlet.servlet

v /QIBM/ProdData/IBMWebAS/servlets/WebBank/CreateAccountServlet.servlet

v /QIBM/ProdData/IBMWebAS/servlets/WebBank/TransactionServlet.servlet

4. The XtremeXML sample use a login.properties for the database access values. We provide a templatefor you to use in the /QIBM/ProdData/IBMWebAS/samples directory. Copy the login.properties file fromthat directory to your /QIBM/ProdData/IBMWebAS/servlets directory. The userid and password valuesshould be left as is unless step 1 above was done. Follow the instructions in login.properties forchanging these variables to your site-specific values:

XtremAdvXml.dbOwner=WBSPHEREXtremAdvXml.dbUserid=nullXtremAdvXml.dbPassword=nullXtremAdvXml.URL=jdbc:db2:sampleXtremAdvXml.dbDriver=com.ibm.db2.jdbc.app.DB2Driver

5. The IBMConnMgrTest and IBMDataAccessTest samples use property filesIBMConnMgrTestStrings.properties IBMDataAccessTestStrings.properties, respectively, for theirdatabase access values. We provide a template for each file in the/QIBM/ProdData/IBMWebAS/samples/database directory. Copy both files from that directory to your

18 Getting Started with WebSphere Application Server for AS/400

Page 25: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

/QIBM/ProdData/IBMWebAS/servlets directory. The userid and password values should be left as isunless step 1 above was done. Follow the instructions in the files to change the db, userid, andpassword values to your site-specific values:

upc.db=sampleupc.owner=CORPDATAupc.userid=nullupc.password=null

IBMConnMgrTest

The IBMConnMgrTest servlet shows how to use the connection manager to manage JDBC connections tothe IBM DB2 sample database. See the Connection manager for a detailed discussion.

To view the sample, use your browser to open the URL of the servlet form:http://your.server.name/servlet/IBMConnMgrTest

XtremeAdventures

This Web application is a travel service. The application enables a Web site visitor to register, view tripdescriptions, select a trip, and view airline flight information, which is is stored in a database. This sampleincludes a JavaBean, servlets, and JavaServer Pages, and the entire site was built using the WebSphereStudio.

To run this application, use either of the following methods:

v Use your browser to open the samples index page and select the Web application:http://your.server.name/IBMWebAS/samples/index.html

v Use your browser to open the URL of the servlet form:http://your.server.name/IBMWebAS/samples/XtremeTravel/index.html

XtremeXML

The XtremeXML sample has three different servlets that implement server-side XML processing. They allquery the Xtreme Adventures flights database, put the results into an XML file, and then convert it toHTML for output - but each servlet uses a different XML parser.

To learn about XML, see What is XML? To learn more about the XML parsers and their use in thesamples, see Developing XML-based applications.

To run XtremeXML:

v Use your browser to open the samples index page and select the sample:http://your.server.name/IBMWebAS/samples/index.html

v Use your browser to open the URL of the servlet form:http://your.server.name/IBMWebAS/samples/XtremeXML/loginForXML.html

WebBank

This on-line banking service uses a JDBC connection to a DB2 database to maintain customer IDs,passwords, and account information. It does its own user authentication, allowing customers to register orlog in, open accounts, deposit, withdraw or transfer funds, and view a log of their transactions. Thissample includes a JavaBean and servlets, and the entire site was built using the WebSphere Studio.

To run this application, use either of the following methods:

v Use your browser to open the samples index page and select the Web application:http://your.server.name/IBMWebAS/samples/index.html

v Use your browser to open the URL of the servlet form:

Setting up WebSphere Application Server 19

Page 26: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

http://your.server.name/IBMWebAS/samples/WebBank/index.html

Hints and tips for problem solving

If you have having problems with the database samples, they are often related to database accessexceptions. Here are some things you can do to find the problems:

v Turn on additional WebSphere Application Server (L)logging to the websphere_trace.log (/L) in thebootstrap.properties file.

v Turn on the debug console to see what exceptions are displayed. You can find instructions in Enablingthe debug console.

v Check the database userID and password in the .servlet files or the .properties files. Verify that theuserid is authorized to the collections by displaying the authorities to the database collection in question.Use the following command:

DSPOBJAUT OBJ(<collection>/<table>) OBJTYPE(*FILE)

If you left the userid and password values blank, the QTMHHTTP userid will be used to access thecollections. The ConfigWAS202 tool automatically gives QTMHHTTP authority to the databases.Otherwise, run the ConfigWAS202 utility specifying the collection and userid to give authority. See/QIBM/ProdData/IBMWebAS/samples/readme.txt for more information on running this utility.

v Check the database URL or name in the .servlet files or the .properties files. The database URL ordatabase name should be the relational database directory entry local to your AS/400 with two slashespreceding. For example, if the value was “MYAS400RDB,” the database URL would be as follows:

jdbc:db2://MYAS400RDB

The dbName or database values would be as follows://MYAS400RDB

Verify the *LOCAL relational database directory entry by displaying the relational database directoryentries. Use the following command:

DSPRDBDIRE RDB(*ALL)

Using the Site Activity Monitor

The Site Activity Monitor is an applet for viewing real-time activity at any of the registered Web siteapplications. When an application is registered, you can use the Site Activity Monitor to see how manyvisitors are currently on each page in that application. You can also view any specific information abouteach visitor that the application might be tracking.

By default, the sample Web site applications are already registered in the AppPackage class. After youcompile and run the sample Web site applications on your server, you will be able to view their activitylocally with this applet. You can also register your own Web applications and then view their activity. Thesections that follow describe how to register applications and invoke the Site Activity Monitor.

Registering with the Site Activity Monitor

By default, the sample Web site applications are already registered in the AppPackage class. Registeryour own applications using the methods provided in the AppPackage class incom.ibm.servlet.personalization.sam.

To register an application:

1. Name the application package with the setPackageName() method.

2. Specify the URI directory path of the HTML pages with the setPackageSubPath() method.

3. Identify each of the pages in that directory with the addLocatable() method.

20 Getting Started with WebSphere Application Server for AS/400

Page 27: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

For example, if your Human Resources department has a Web site with four HTML pages for employeebenefit information in the HR/benefits/ directory, you might add this code to the first servlet the applicationexecutes:

AppPackage ap = new AppPackage();ap.setPackageName(new String(“EmpBenefits”));ap.setPackageSubPath(new String(“/HR/benefits/”));ap.addLocatable(new String(“main.html”));ap.addLocatable(new String(“health.html”));ap.addLocatable(new String(“leave.html”))ap.addLocatable(new String(“retire.html”));;int i = AppPackage.addAppPackage(ap);

Invoking the Site Activity Monitor

Site Activity Monitor is supported for JDK 1.1 enabled browsers.

To invoke the Site Activity Monitor applet on your own Web site, open the appropriate main page with yourbrowser. For example, use the browser to open the URL:http://your.server.name/IBMWebAS/sam/sam11.html

where your.server.name is the host name of your Web server. These main pages provide instructions fornavigating Web sites, displaying session and user information, controlling the display, and sendingmessages to Web site visitors.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Troubleshooting WebSphere Application Server

Having problems with WebSphere Application Server? This topic describes troubleshooting strategies youcan employ to resolve the problems.

Note:For the latest troubleshooting information, visit the WebSphere Application Server for AS/400

product Web site at http://www.as400.ibm.com/websphere (Clicking this link opens a newbrowser.)

See the following topics for information about troubleshooting:

Common servlet problemsCheck this topic for solutions to common servlet problems.

Check WebSphere Application Server logs for troubleshooting informationThis topic explains the various methods that WebSphere Application Server provides for loggingerrors, events, exceptions, and standard output.

If you still need help, you can post a message on AS/400 Technical Support’s WebSphere Forum at

http://as400service.ibm.com/w_dir/WSDiscuss.nsf/By+Category?OpenView (Clicking this link opens anew browser session.)

Also see Getting support for WebSphere Application Server for AS/400 for details about getting supportfrom IBM for WebSphere Application Server for AS/400 and how to report problems with the product.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Setting up WebSphere Application Server 21

Page 28: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

Common servlet problemsWhy am I getting errors when I try to compile my servlet?

Make sure that your classpath is set correctly. The AS/400 system classpath is automaticallyconfigured for the Java class packages, but you must add the WebSphere Application Server classpackages before the compiler can find the servlet packages. See Setting your CLASSPATHenvironment variable for more information about how to do this.

Why am I getting a “404 Not Found - Cannot load local code MyServlet” when I try to executeMyServlet servlet?

This error may be occurring because a class used by MyServlet servlet may not be found.WebSphere Application Server uses the classpath value specified in property java.classpath,located in the /QIBM/ProdData/IBMWebAS/properties/bootstrap.properties file. Make sure the allclasses that your servlet depends on are in this classpath.

This may also simply mean your servlet is not in one of the servlet directories to be found byWebSphere. For more information, see Servlet directories.

Why am I getting a “404 Not Found - file doesn’t exist or is read protected [even tried multi]” erroron my browser?

This error may be caused by a misplaced Pass directive in the HTTP config file. If you have the“catch-all” (e.g. Pass /*) Pass directive before the Service directive, the Service directive will neverbe referenced. To correct this problem, either move the Pass directive to the end of your HTTPconfig entries or make it more specific (e.g. Pass /*.html).

Where do I check error messages for my servlets?If the application servlet failed for some reason, you will most likely see the error logged in thefollowing log file /QIBM/ProdData/IBMWebAS/logs/servlet/servletservice/error_log. For moreinformation about log files, see Logging errors and events.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Checking WebSphere Application Server logs for troubleshootinginformation

Use the following log files to help determine the source of a problem.

Logging errors and events

Use the WebSphere Application Server Manager to manage and display your your error and event logfiles.

During operation, WebSphere Application Server writes events (such as class loading messages) anderrors (such as runtime exceptions) to the event_log and error_log files, respectively. These files arelocated in the /QIBM/ProdData/IBMWebAS/logs/servlet/servletservice directory. The logs are viewable fromthe WebSphere Application Server Manager in the Server Execution Analysis -> Monitors -> Log Outputpage.

Note: You can change default error and event settings in the WebSphere Application ServerManager. For more information, see Server Execution Analysis.

To view the error and event logs from WebSphere Application Server Manager, follow these steps:

1. Start the WebSphere Application Server Manager

2. In the navigation menu, click the black arrow next to Server Execution Analysis . Click the blackarrow next to Monitors , then click Log Output .

The Log Output Monitor page appears.

3. Select either Error or Event from the Log File menu.

22 Getting Started with WebSphere Application Server for AS/400

Page 29: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

4. Click Start View to begin displaying log messages. By default, the display updates itself every fiveseconds.

5. Click Stop View to stop displaying log messages.

For more information about the Log Output Monitor page, see the Server Execution Analysis -> Monitors-> Log Output reference.

Exceptions

You can view exceptions that are logged to the error_log file from the WebSphere Application ServerManager in the Server Execution Analysis -> Monitors -> Exceptions page. To view exceptions, followthese steps:

1. Start the WebSphere Application Server Manager

2. In the navigation menu, click the black arrow next to Server Execution Analysis . Click the blackarrow next to Monitors , then click Exceptions .

The Exceptions Monitor page appears.

3. Click Start View to begin displaying exceptions.

4. Click Stop View to stop displaying exceptions.

For more information about the Exceptions Monitor page, see the Server Execution Analysis -> Monitors ->Exceptions reference.

Standard Output and Error Logs (Java virtual machine trace)

Messages sent to System.out or System.err in the Java virtual machine are written to files. By default,System.out messages are written to /QIBM/ProdData/IBMWebAS/logs/jvm_stdout.log. System.errmessages are written to /QIBM/ProdData/IBMWebAS/logs/jvm_stderr.log.

Note: You can change the settings for the standard output logs by editing the/QIBM/ProdData/IBMWebAS/properties/server/servlet/debug.properties file. The property names aredebug.java.stdout.file and debug.java.stderr.file.

These files are useful for custom application trace data and for finding unexpected or uncaught exceptionsthat were thrown by the application or servlet engine, but were not placed in the error_log file.

Tracing

Messages generated by the native portion of the WebSphere Application Server system are printed toseparate files. The most important error, warning, and informational messages are written directly to theIBM HTTP Server’s error log file. Additional trace data can be generated by setting the ose.native.traceproperty in /QIBM/ProdData/IBMWebAS/properties/bootstrap.properties file to true. This flag causes tracedata to be dumped to the file /QIBM/ProdData/IBMWebAS/logs/trace/trace.{ID}.log, where ID is agenerated identification number.

Note: If you are familiar with WebSphere Application Server 1.1 for AS/400, these trace logs replacethe version 1.1 ncf.log.

When running WebSphere Application Server in stand-alone (or out-of-process) mode, additional tracemessages are written to files that begin with “oop” in the /QIBM/ProdData/IBMWebAS/logs directory.

AS/400-specific log

WebSphere Application Server for AS/400 provides an extra, AS/400-specific log. The log file is calledoop_se_launcher.log, and it is written to the /QIBM/ProdData/IBMWebAS/logs directory. This file logs

Setting up WebSphere Application Server 23

Page 30: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

approximately five or six events while WebSphere Application Server is starting. Logging is terminatedwhen the servlet engine starts. Check this log file when you are having problems starting WebSphereApplication Server.

[ Legal ][ Copyright and Trademark ][ Feedback ]

Getting support for WebSphere Application Server for AS/400

Support services for the IBM WebSphere Application Server for AS/400 are provided under the usualterms and conditions for AS/400 software products. Support services include program services, voicesupport, and consulting services. Use the online information that is provided at

http://www.as400.ibm.com/Support/Index.htm for more information. Use IBM Support Services for5769-AS1 (IBM WebSphere Application Server for AS/400). Or, contact your local IBM representative.

Resolving defects of the IBM WebSphere Application Server for AS/400 program are supported underprogram services or voice support. Resolving application programming or debugging issues are supportedunder consulting services.

All programming assistance is supported under consulting services. This includes the program samplesthat are provided in the IBM WebSphere Application Server for AS/400 licensed program (LP) product.

Additional samples may be available on the Internet at http://www.as400.ibm.com/ on an unsupportedbasis.

The IBM WebSphere Application Server for AS/400 licensed program provides information about solvingproblems. If you believe that there is a potential defect in the IBM WebSphere Application Server forAS/400, a simple program that demonstrates the error is required.

For the latest information about WebSphere Application Server, check the IBM WebSphere Application

Server for AS/400 product Web site at http://www.as400.ibm.com/websphere

Getting fixes for IBM WebSphere Application Server for AS/400

Program fixes for 5769-AS1 (IBM WebSphere Application Server for AS/400) are available via AS/400Program Temporary Fixes (PTFs). Use the online information that is provided at

http://as400service.rochester.ibm.com/ for more information. Order Group PTF SF99027 to obtainprogram fixes for IBM WebSphere Application Server for AS/400. Or, contact your AS/400 service provider.

For the latest information about fixes, see the IBM WebSphere Application Server for AS/400 product Web

site at http://www.as400.ibm.com/websphere

[ Legal ][ Copyright and Trademark ][ Feedback ]

Other resources

AS/400-specific resources

Web sitesIBM WebSphere Application Server for AS/400 product Web site

http://www.as400.ibm.com/websphere

24 Getting Started with WebSphere Application Server for AS/400

Page 31: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

See this Web site for the most current information about WebSphere Application Server forAS/400, including fixes, documentation updates, and FAQs.

IBM HTTP Server for AS/400 product Web site

http://www.as400.ibm.com/http

See this Web site for information about IBM HTTP Server for AS/400.

AS/400 Partners in Development Web site for Java

http://www.as400.ibm.com/developer/java

See this Web site for AS/400 Partners in Development resources for Java, including articles, whitepapers, education, FAQs, magazines, manuals, Redbooks, and newsletters.

ManualsAS/400 Information for Java

http://publib.boulder.ibm.com/pubs/html/as400/v4r4/ic2924/info/java/index.htm

This site provides links to V4R4 AS/400 manuals for Java, including AS/400 Developer Kit forJava, AS/400 Toolbox for Java, and Qshell Interpreter.

IBM HTTP Server for AS/400 Webmaster’s Guide (GC41-5434)

http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/QB3AEO04/CCONTENTS

See this book for information about how to install and configure IBM HTTP Server for AS/400.

RedbooksBuilding AS/400 Internet-Based Applications with Java (SG24-5337)

http://www.redbooks.ibm.com/abstracts/sg245337.html

This redbook focuses on building applets and servlets that access AS/400 resources. It providesmany practical programming examples with detailed explanations of how they work.

ForumsAS/400 Technology Forums: WebSphere Application Server

http://as400service.ibm.com/w_dir/WSDiscuss.nsf/By+Category?OpenView

This AS/400 Technical Support Web-based forum is dedicated to WebSphere Application Serverfor AS/400.

Other IBM resources

Web sitesIBM Software: WebSphere Application Server product Web site

http://www.software.ibm.com/webservers/appserv/

The home for IBM WebSphere Application Server, see this Web site for multi-platform informationabout the product.

IBM developerWorks: Java technology Web site

http://www.ibm.com/developer/java

IBM’s home page for Java technologies, see this Web site for IBM news, tools, education,developer programs, and resources for Java.

Setting up WebSphere Application Server 25

Page 32: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

IBM developerWorks: XML Web site

http://www.ibm.com/developer/xml

IBM’s home page for XML technologies, see this Web site for IBM news, tools, education,developer programs, and resources for XML.

RedbooksWebSphere Application Servers: Standard and Advanced Editions (SG24-5460)

http://www.redbooks.ibm.com/abstracts/sg245460.html

Although this redbook focuses on the AIX and Windows NT platforms, it contains good informationabout the WebSphere Application Server product in general, such as planning for andtroubleshooting WebSphere Application Server

NewsgroupsIBM Software: WebSphere Application Server newsgroup

news://news.software.ibm.com/ibm.software.websphere.application-server

This USENET newsgroup is dedicated to WebSphere Application Server on all platforms.

Java resourcesSun Microsystems Java Technology Web site

http://java.sun.com

Sun’s home page for Java technology, this Web site is a valuable resource for Java news,specifications, products, APIs, and documentation.

Sun’s Java Servlet API Web site

http://java.sun.com/products/servlet/index.html

See this site for servlet specifications, the Java Servlet API, and Java Servlet Development Kit(JSDK) downloads.

Sun’s JavaServer Pages (JSP) Web site

http://java.sun.com/products/jsp/index.html

See this site for JSP specifications, APIs, FAQs, white papers, and other resources.

[ Legal ][ Copyright and Trademark ][ Feedback ]

26 Getting Started with WebSphere Application Server for AS/400

Page 33: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page
Page 34: Getting Started with WebSphere Application Server for AS/400apollo.dpslink.com/internal/teamweb/Education/WebSphere... · 2000-04-24 · v Plug-in for IBM HTTP Server for AS/400 (page

IBMR

Printed in U.S.A.