BEA Logo BEA WebLogic Server Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

WebLogic for IBM AS/400e Technical FAQ

AS/400-specific differences in WebLogic
  1. In general, how does WebLogic on the AS/400 differ from WebLogic on Windows or UNIX?
  2. WebLogic installation directory
  3. How do you run WebLogic utility programs on a client?
  4. Working with example files
  5. weblogicaux.jar is three files on AS/400 V4R3

General questions about Java on AS/400
  1. How do you edit stream files on the AS/400?
  2. How do I set the WebLogic classpath on the AS/400?
  3. How do I set the WebLogic classpath on a client workstation?
  4. Why does the WebLogic Server still not find classes when I've set the classpath?
  5. Can I use Qshell with Java and WebLogic on the AS/400?
  6. How can I improve Java performance on my AS/400?
  7. How do you create direct executable Java programs?
  8. How do you run an AS/400 program or CL command from Java?
  9. How should I set the STRWEBL command garbage collection parameters?

Questions about installation
  1. How do I give WLADMIN privileges to an existing user?
  2. Installation failed. How can I find the problem?
  3. How do I uninstall WebLogic?

Questions about using DB2 with WebLogic
  1. How do I set up DB2 to work with the WebLogic Server?
  2. What are the JDBC drivers for AS/400 DB2?

More resources

AS/400-specific differences in WebLogic

Q In general, how does WebLogic on the AS/400 differ from WebLogic on Windows or UNIX?

A The WebLogic Java code is the same on all platforms. IBM has created a Java environment for the AS/400 that is highly compatible with the Java standard and at the same time able to exploit the strengths of the AS/400. WebLogic is packaged for the AS/400 by creating direct executables for all class files, adding AS/400 installation commands, and creating a save file that you restore on your AS/400.

If you use WebLogic on Windows NT or UNIX, you will notice some differences when you run WebLogic on the AS/400. The differences are environmental, resulting from the Java virtual machine on the AS/400, the powerful security system on the AS/400, or the design of the OS/400 operating system. Also, since the AS/400 is designed as a business server, you cannot run the graphical interfaces provided with the WebLogic Server on the AS/400 -- you must run them from a client computer.

One of the primary features of the AS/400 Java environment is the direct executable. The AS/400 JVM transforms Java class files into AS/400 direct executables, resulting in faster execution than a standard Java byte code interpreter. Although this conversion happens automatically, it can be time-consuming and produce noticeable pauses in execution. Also, the AS/400 CRTJVAPGM command that creates direct executables is capable of various levels of optimization. The WebLogic classes are transformed to direct executables with maximum optimization. We recommend that you also transform your own Java classes before you place your application into production on an AS/400.

Q WebLogic installation directory

A WebLogic for IBM AS/400 installs in the AS/400 IFS in the /weblogic/version directory, where version is the three-digit WebLogic release number. For example, WebLogic release 4.5.0 installs into the /weblogic/450 IFS directory. On UNIX and Windows, the installation location can be selected at installation time. The WebLogic documentation often refers to the weblogic/ directory as the WebLogic installation directory. For AS/400, you can map this to /weblogic/version.

Q How do you run WebLogic utility programs on a client?

A The WebLogic Server runs on the AS/400. Other WebLogic utility programs and example programs can also run on the AS/400 if they do not require a windowing system. However, some WebLogic programs, such as the WebLogic Console and the ZAC must be run on a Windows NT client workstation. The programs can be loaded from the AS/400 and executed in a JVM on the workstation.

Q Working with example files

A The example files in the /weblogic/version/examples directory cannot be altered without special permissions. To try the examples out, first copy them to another directory. You can use the build scripts for Windows NT to build the examples on a workstation.

Q weblogicaux.jar is three files on AS/400 V4R3

A The V4R3 JVM restricts .jar files to 2MB. Therefore, in the V4R3 version, the weblogicaux.jar file is provided as four .jar files named weblogicaux0.jar, weblogicaux1.jar, and weblogicaux2.jar. You must place each of these files in the AS/400's CLASSPATH and in any client CLASSPATH that executes WebLogic programs from the AS/400 file system.

The limit on .jar file size does not exist on V4R4, so the weblogicaux.jar file is a single .jar file in the WebLogic release for V4R4.

General questions about Java on AS/400

Q How do you edit stream files, such as Java program files, on the AS/400?

A Java source code (.java files) and other files such as the WebLogic properties file (/weblogic/version/weblogic.properties) are ASCII stream files in the AS/400 IFS. You can't use the source entry utility (SEU) to edit these files directly. Here are four alternatives for editing these files:

  1. Map the IFS structure as a network drive on your PC using Client Access. Then use your favorite PC editor to create and edit stream files.

  2. Use FTP to move stream files between the AS/400 IFS directories and your using PC. You can edit these files with your favorite editor on the PC.

  3. There are two utilities that allow you to update stream files directly on your AS/400. These utilities are EDTF (to create and edit stream files) and DSPSTMF (to display stream files). These utilities are available in V4R3 with the 5769SS1-SF49052 PTF. Applying the PTF is not sufficient. Follow the instructions found in the cover letter to finish installing the utilities.

  4. You can use STRSEU to edit a file as a source file member. Use CPYTOSTMF to copy to an IFS ASCII stream file and CPYFMSTMF to copy from an IFSASCII stream file.

Q How do I set the WebLogic classpath on the AS/400?

A Before you start the WebLogic Server, or run any of the WebLogic utility programs on the AS/400, you must add the WebLogic classes to your classpath. The classpath must contain these directories and .jar files:

OS/400 V4R3

  • /weblogic/version/classes
  • /weblogic/version/lib/weblogicaux0.jar
  • /weblogic/version/lib/weblogicaux1.jar
  • /weblogic/version/lib/weblogicaux2.jar
  • /weblogic/version/license

OS/400 V4R4

  • /weblogic/version/classes
  • /weblogic/version/lib/weblogicaux.jar
  • /weblogic/version/license

The version directory is the WebLogic release number. For example, WebLogic version 4.5.0 installs into the /weblogic/450 directory.

There are a number of ways to set your classpath on the AS/400:

  • Enter the classpath value as a parameter when you run the STRWEBL command. (Type WEBLOGIC/STRWEBL at the prompt and press F4 instead of ENTER.) The default value is *ENVVAR, which means the classpath is taken from the CLASSPATH environment variable. If the environment variable is not set, you must type the path in the Classpath field.

  • Use the ADDENVVAR command to add the CLASSPATH variable to your environment.

  • If the CLASSPATH variable is already in your environment, use CHGENVVAR to change it.

  • You can use the WRKENVVAR command to add new environment variables or modify existing environment variables.

Here is the command to set the classpath on a V4R3 AS/400 using the ADDENVVAR command. (The command is displayed on several lines here for clarity, but you should type it without line breaks when you enter it.)

  ===> ADDENVVAR ENVVAR(CLASSPATH) VALUE(
       '.:/weblogic/version/classes:
       /weblogic/version/license:
       /weblogic/version/lib/weblogicaux0.jar:
       /weblogic/version/lib/weblogicaux1.jar:
       /weblogic/version/lib/weblogicaux2.jar')

On a V4R4 AS/400, substitute /weblogic/version/lib/weblogicaux.jar for the four .jar files.

Q How do I set the WebLogic classpath on a client workstation?

A To run WebLogic utility programs on a client workstation, you first add the WebLogic classes to the workstation's CLASSPATH environment variable. The workstation must have Client Access installed, or a similar utility that allows the client to have network access to the AS/400 file system.

Your classpath also needs to include the Java runtime classes.

In the following example, drive F: is mapped to the AS/400 file system, and the JDK is installed in the c:\jdk directory. The command, for a V4R3 system, is shown on multiple lines for readability, but you should type it as a single command with no breaks:

 C:\>SET CLASSPATH=c:\jdk\lib\classes.zip;
      f:\weblogic\version\classes;
      f:\weblogic\version\license;
      f:\weblogic\version\lib\weblogicaux0.jar;
      f:\weblogic\version\lib\weblogicaux1.jar;
      f:\weblogic\version\lib\weblogicaux2.jar

Q Why does the WebLogic Server still not find classes when I've set the classpath?

A If you are having trouble with CLASSPATH on the AS/400, here are a couple of things to look for:

  • The CLASSPATH must not contain any spaces. Check that there are no spaces at the beginning, end, or anywhere in the middle of the value.
  • If you use Client Access, be very careful with Windows copy and paste. When you paste the value at the AS/400 prompt, it may be corrupted. It looks correct after you paste, but when you go back and look at it later, you will notice missing characters.

For more help on setting your classpath, check our Administrators Guide, Setting classpath.

Q Can I use Qshell with Java and WebLogic on the AS/400?

A You can use Qshell to run Java programs and WebLogic utilities, such as utils.t3dbping and utils.licenses.

Warning. Never start the WebLogic Server on the AS/400 with java commands described in the WebLogic documents. Always use the WEBLOGIC/STRWEBL command to start the WebLogic Server because it runs the server as the WEBLOGIC user. If you run the WebLogic Server using a java command, the server runs under your current user profile. Depending on your profile, the WebLogic Server will have security problems when you run this way, or in subsequent sessions that start with the WEBLOGIC/STRWEBL command.

Your classpath must include the WebLogic classes. With Qshell, you must also set the QIBM_MULTI_THREADED environment variable to 'Y' before you run the JAVA or RUNJAVA commands.

If you set environment variables in your AS/400 command session before you start Qshell, the variables remain set in Qshell, unless a .profile file in your home directory or the /etc/profile file resets environment variables.

You can set environment variables for every interactive Qshell shell you start with STRQSH or QSH by setting the CLASSPATH in the .profile file in your home directory.

An administrator can set environment variables globally by adding them to the /etc/profile file, which is executed whenever any user starts a Qshell shell with the STRQSH or QSH commands.

To set the environment variables in Qshell, use the following commands at the prompt, or add them to one of the profile files mentioned above:

$ export -s CLASSPATH=.:/weblogic/version/classes:
      /weblogic/version/license:
      /weblogic/version/lib/weblogicaux0.jar:
      /weblogic/version/lib/weblogicaux1.jar:
      /weblogic/version/lib/weblogicaux2.jar

$ export -s QIBM_MULTI_THREADED=Y

If you have a V4R4 system, substitute weblogicaux.jar for the four .jar files.

Q How can I improve Java performance on my AS/400?

A The most important factor contributing to the performance of AS/400 Java applications is the use of the CRTJVAPGM command. This command transforms Java class and jar files to program objects that contain fully compiled 64-bit RISC machine instructions. The resulting object is called a DE (Direct Executable). If a DE exists before the JVM executes a class, there is a dramatic increase in performance. On the other hand, if the DE does not exist, the JVM creates a DE on the fly, and performance suffers. The next question has information about creating a DE.

There are many other ways to improve and analyze performance of AS/400 Java applications. A good starting place is AS/400e series Java Information on the Web, particularly Building AS/400 Applications with Java. This is the IBM Redbook titled "AS/400 Appls with Java-Version 2". It covers many topics including performance analysis and enhancement.

Q How do you create direct executable Java programs?

A If you install or modify Java class files called by the WebLogic Server, you can boost performance by creating an AS/400 direct executable for the class with the CRTJVAPGM command. Running this command once prevents the AS/400 JVM from compiling the class every time it is loaded.

In particular, when you Install a WebLogic license, you modify the WebLogicLicense.java file and run the JAVA command to create a new class file. On the AS/400, you should then run the CRTJVAPGM command on the WebLogicLicense.class file so that the class is not recompiled whenever it is loaded.

Here is the command to create a direct executable for the WebLogic license class:

===> CRTJVAPGM 
     CLSF('/weblogic/version/classes/WebLogicLicense.class')
     OPTIMIZE(40)

You can choose an optimization level of 0, 10, 20, 30, or 40. A higher level spends more time, but produces a faster direct executable. The WebLogic direct executables are produced at optimization level 40.

Q How do you run an AS/400 program from Java?

A The AS/400 Toolbox for Java includes Access classes that provide access to various AS/400 services, including the ability to run AS/400 programs and CL commands, and access AS400 files and objects. In Java, you create an AS400 object for a specified AS/400 Server and then use methods on that object to access AS/400 facilities. See the AS/400 Toolbox for Java web page for examples and more information.

Q How should I set the STRWEBL command garbage collection parameters?

A The WEBLOGIC/STRWEBL command's default value for the "Garbage collection initial size" parameter is 65536 (64MB). The default for the "Garbage collection maximum size" is *NOMAX.

If you change these parameters, you should allocate at least 65536 kilobytes for the garbage collection initial size parameter. If you choose to change *NOMAX to a specific value for the maximum garbage collection size, make sure that you use a size greater than the initial size, because the AS/400 JVM's garbage collection mechanism performance degrades when the initial and maximum garbage collection memory sizes are equal. The STRWEBL command will not permit a maximum smaller than the initial size.

Questions about installation

Q How do I give WLADMIN privileges to a user?

A WebLogic administrative users have *ALL authority for the commands in the WEBLOGIC library and *RWX authority on certain files in the /weblogic directory. To allow a user to start and stop the server or to modify any of these files, you can add GRPPRF(WLADMIN) to their profiles.

To create a new user with authority to administer the WebLogic Server, use this command:

  ===> CRTUSRPRF USRPRF(USERNAME) GRPPRF(WLADMIN)

To add authority to administer the WebLogic Server to an existing user, use this command:

  ===> CHGUSRPRF USRPRF(USERNAME) GRPPRF(WLADMIN)

Q Installation failed. How can I find the problem?

A If the WEBLOGIC/INSWEBL command fails, follow this procedure to retry the installation and identify the failure:

  1. If the /weblogic IFS directory exists, make sure that it belongs to the WEBLOGIC user, which is true if the directory was created with the INSWEBL command. If the directory was created with another user profile, INSWEBL is unable to set permissions in the directory.

  2. Delete the WEBLOGIC library:
      ===> DLTLIB WEBLOGIC

  3. Restore from the save file:
      ===> RSTLIB SAVLIB(WEBLOGIC) DEV(*SAVF) SAVF(QGPL/WEBLversion)

  4. Request detailed command output:
      ===> CALL QCMD

  5. Run INSWEBL again:
      ===> WEBLOGIC/INSWEBL

If the installation fails again, the additional information displayed when you use the CALL QCMD command will help technical support diagnose the problem.

Q How do I uninstall WebLogic?

A Follow these steps to uninstall WebLogic:

  1. Make sure that the WebLogic Server is not running. Run the WRKACTJOB command and look for STRWEBL. If the WebLogic Server is running, shut it down before you continue.

  2. Delete the WEBLOGIC library:
      ===> DLTLIB WEBLOGIC

  3. Delete the save file:
      ===> DLTF WEBLversion.SAVF

  4. Save any custom files you want to save from the /WEBLOGIC directory to another directory. Otherwise, you will lose these file when you delete the /WEBLOGIC directory in next step.

  5. Remove the /WEBLOGIC directory. If you have Qshell, you can carefully use this command to remove the directory:
     $ rm -r /WEBLOGIC

    If you do not have Qshell, use Windows Explorer from a client machine.

    In either case, it takes a very long time to remove the /WEBLOGIC directory from the AS/400 file system.

  6. Remove the WLADMIN and WEBLOGIC profiles:
      ===> DLTUSRPRF USRPRF(WLADMIN)
      ===> DLTUSRPRF USRPRF(WEBLOGIC)

Questions about using DB2 with WebLogic

Q How do I set up DB2 for use with WebLogic?

A You can use the WebLogic Server in a multitier JDBC connection to DB2 -- the client application connects to the WebLogic Server using WebLogic JDBC, and the WebLogic Server connects to DB2 using one of IBM's JDBC drivers for DB2.

You can define a connection pool in the weblogic.properties file. The connection pool specifies a number of database connections that the WebLogic Server opens and allocates to clients that request them. Opening a database connection is a fairly expensive operation, and setting up a pool of shared connections minimize the number of open operations. A pool is especially beneficial when a large number of clients execute short-duration transactions.

Before the WebLogic Server can connect to DB2, there must be an entry in the AS/400 Relational Database Directory. You can use the DSPRDBDIRE command to see if the entry has been made. If there is no entry, use the ADDRDBDIRE entry to add the entry.

the WebLogic Server also requires a JDBC driver for DB2. The next question describes the JDBC drivers available from IBM.

To define a connection pool, you add a weblogic.jdbc.connectionPool property to the weblogic.properties file. Here is the syntax for the property:

weblogic.jdbc.connectionPool.virtualName=\
         url=jdbc:db2:rdbdire/defCollection,\
         driver=jdbcDriver,\
         initialCapacity=initialN,\
         maxCapacity=maxN,\
         capacityIncrement=incrementInterval,\
         props=jdbcConnectionProps
Parameter Description
virtualName A name for the connection pool. Although this is an optional parameter, you need it to reference in the Access Control Lists (ACLs) that control access to the connection pool.
rdbdire The name of local database in the Relational Database Directory. You can see this name with the DSPRDBDIRE command.
defCollection The default collection is "QGPL". You can specify a different default collection with this parameter.
driver The full package name of the JDBC driver for DB2. The JDBC drivers that IBM provides for DB2 are described in the next question.
initialCapacity The number of database connections to open initially. Use 0 if you want to wait until a client requests a connection. Otherwise, the WebLogic Server opens the connections when it starts up.
maxCapacity The maximum number of connections to open. When all connections in a pool are in use, the WebLogic Server opens more connections until the maximum number are open. When no more connections are available in the pool and no more can be opened, client requests are refused.
capcityIncrement The number of connections to open at a time. When all connections in the pool are in use the WebLogic Server adds this many connections to the pool, up to the maximum specified
props Properties to pass to the JDBC driver, in a semicolon-separated list. The properties needed for DB2 include the database username and password, and the server name.

If you have problems with a DB2 JDBC connection, this AS/400 JDBC FAQ is a good place to look for help.

Here is an example connection pool, with the virtual name "finance", that uses the Type 2 JDBC driver. The database name (displayed by the DSPRDBDIRE command) is "FIN400E". The pool is defined so that the WebLogic Server does not open any connections until one is requested, and then opens 3 connections at a time until a maximum of 12 connections are in the pool. The connections are opened by user "nick" with the password "HedGe!HoG89".

weblogic.jdbc.connectionPool.finance=\
   url=jdbc:db2://FIN400E,\
   driver=com.ibm.db2.jdbc.app.DB2Driver,\
   initialCapacity=0,\
   maxCapacity=12,\
   capcityIncrement=3,\
   props=user=nick;password=HedGe!HoG89;server=LOCALHOST

A connection pool also requires an ACL to allow clients to obtain a connection from the pool, and an ACL that allows someone to reset the connection pool if needed:

weblogic.allow.reserve.weblogic.jdbc.connectionPool.virtualName=list
weblogic.allow.reset.weblogic.jdbc.connectionPool.virtualName=list

For example, the following ACLs allow anyone (group "everyone") to use a connection from the "finance" pool, but only users "nick" and "tracey" can reset the connection pool:

weblogic.allow.reserve.weblogic.jdbc.connectionPool.finance=everyone
weblogic.allow.reset.weblogic.jdbc.connectionPool.finance=nick tracey

Q What are the JDBC drivers for AS/400 DB2?

A IBM provides type 2 and type 4 JDBC drivers for AS/400 DB2. The type 2 driver is native AS/400 code, appropriate when a Java application (such as the WebLogic Server) and DB2 are executing on AS/400 machines. The type 4 driver is pure Java and can execute on the AS/400 or on another platform running Java. If you run WebLogic on a non-AS/400 computer, you must use the type 4 driver on that computer. Also, if you write applets that are served by WebLogic on the AS/400 computer, you must install the type 4 driver so that browsers on any platform can access DB2 on the AS/400.

The type 2 driver is packaged with the AS/400 Developer Kit for Java (5769-JV1). The type 4 driver is packaged with AS/400 Toolbox for Java (5769-JC1).

When you use a JDBC driver, whether in a two-tier or three-tier configuration, you need to know the full pathname to the driver class file and the connect URL for the driver. Here is the information you need for the AS/400 type 2 and type 4 drivers:

Type 2 driver
Package 5769-JV1
Driver class com.ibm.db2.jdbc.app.DB2Driver
Driver URL jdbc:db2://hostname/database

Type 4 driver
Package 5769-JC1
Driver class com.ibm.as400.access.AS400JDBCDriver
Driver URL jdbc:as400://hostname/database

 

Copyright © 2000 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
Last updated 12/1/1999