Configuring your iSeries Java runtime environment

Use the third page of the Program Call wizard to set the authentication and runtime configuration values for the iSeries programs and procedures called from your Java or Web application.

Authentication

Use the Authentication tab to specify how to connect and authenticate Java or Web applications that perform program calls to an iSeries host. For a Services bean, the Program Call wizard always generates a runtime configuration file . For a Java application bean, you can choose to generate the file or not. By default, this file is called defaultPCW.config and is located at the Java source folder of your project. You can override this file by generating your own configuration file that can apply to any one or more Java beans in your project.
  • If you selected Java application on page two of the wizard, Generate configuration file is selected by default. If you clear it, none of the fields on this page are available.
  • If you selected Services on page two of the wizard, Generate configuration file is selected by default. You must keep this setting.
You can choose another configuration file in the drop-down list, or you can type in a new configuration file name. The list contains the names of all the .config files in your project. More than one Java bean can refer to the same .config file.

Library List

Optional: Use the Library List tab to define the runtime library list information for Java or Web applications that perform program calls to an iSeries host.
  1. Add any runtime libraries that your program requires in the Runtime library list area. This results in the libraries being added to the library list on the iSeries server when the job is first created and before the iSeries program or procedure is invoked.
    1. Enter the name of the library in the Library field and click Add to add it to the list.
    2. Click the Library Position field and select *FIRST or *LAST to indicate whether the library should be added first or last in the list. Press Enter to save the entry in the library list. The libraries in the list are used by the program at run time.
    3. To remove a library from the list, select the library and click Remove.
    4. Use Move Up and Move Down to change the order of the libraries in the list.
  2. If you select *CRTDFT for Current library, any objects that are created into the current library using *CURLIB on the create command, the QGPL library is used as the default current library. If you select *USRPRF for Current library, then the setting in the user profile is used.
  3. In the Initial command field, specify the host command to run after signing on to the host system. For example, you can specify a CL setup program to set the environment before invoking applications. This program could add additional libraries to the library list, depending on the user ID.
  4. Click Next to view summary information, or click Finish.
The runtime configuration file

A runtime configuration file with all your settings is generated and placed in the source folder of the Java project. By default, all the Java beans generated from the PCML file will use the same file for their runtime configuration, and the file is called defaultPCW.config. You can override this file by generating your own configuration file which can apply to one or more Java beans in your project.

The generated Java bean, by default, looks for the runtime configuration file in the class path. If the file is found, the Java bean uses the runtime settings in the file. If the file is not found, the client application has to set the runtime properties for the Java bean. However, even if the file is found, the client application can override the settings in the file by using the corresponding methods of the generated Java bean.

  • If defaultPCW.config exists, then the fields under both tabs are prefilled with data from defaultPCW.config for a new Program Call bean.
  • If your project is a Java project, and defaultPCW.config does not exist, then the authentication method defaults to Specify signon values, and all the fields are left blank.
  • If your project is a Dynamic Web project, and defaultPCW.config does not exist, then data are retrieved from the web.xml file.

Additional considerations

In addition to using this page of the Program Call wizard to define authentication and runtime values, you need to ensure that host servers are running on your iSeries host. The servers are *SRVMAP, *CENTRAL, *RMTCMD, and *SIGNON.

You start a host server with the STRHOSTSVR command. For example, enter STRHOSTSVR *RMTCMD to start the *RMTCMD server. To start all host servers, use the command STRHOSTSVR *ALL.

To test iSeries Web applications in the WebSphere Test Environment, you need a TCP/IP connection to your iSeries host, and the user profile QUSER must be enabled.