Addressing common run-time errors

If an error is encountered while your program is running, error information is displayed on the error page you specified for the interaction. To see these errors, the check box Display detailed runtime errors must be checked in the iSeries Web Tools Run-time Configuration wizard.

Following are the common run-time errors related to Web applications and a brief description of their meaning:

Support files are not updated in your Web project
When you create the first Web interaction for a Web project, a number of support files are copied into it. If you upgrade the product to a new release, or you apply fixes, these support files need to be updated in your Web project. To update these files, select the Web project name, right click and select Migrate > iSeries Web Tools project in the menu. When the Confirm Migration window appears, click OK to update the files. Note that you must close all views before performing the migration.
Ensure a session variable exists
If you modify a JSP file in your Web project to reference a session variable, you can add additional code to your JSP file to ensure that the session variable exists. For example, if you code the following in your JSP file:
String s1 = (String)session.getAttribute("custno");
but the session variable custno does not exist, or you incorrectly typed the name, you receive a null pointer exception in the error page.

To avoid the null pointer exception message, add the following code to your JSP file to verify that the session variable exists:

<% String s1 = (String)session.getAttribute("custno");
    if (s1 != null) { %>
      Customer number= <%= s1 %>
<% } %>

Note that session variable names are case sensitive and must be the same as the service program that has been defined in the WIT file. Also ensure that Save to Session is set to true on the Map and Link the Output Parameters to the Output Fields page of the Web interaction wizard.

java.net.UnknownHostException
A connection could not be made to the iSeries host system. Open the iSeries Web Tools Run-time Configuration wizard and ensure the iSeries host name is correct. This value is not case sensitive. You can also try using the host IP address in the host name field. Also make sure that you can ping the host system.
Value not set
This usually means that you have an input parameter in your procedure but you did not map an iSeries Web component to it. Rerun the associated interaction and verify that all input parameters have iSeries Web components mapped to them.
ObjectDoesNotExistException
The program, service program, or library was not found. Rerun the interaction and check that the names are correct.
InvalidTransactionException
Typically means that there was an error invoking your program or procedure. Usually the cause of any of the errors can be found by viewing the job log for the job using the WRKJOB command. The iSeries job number is displayed on the error page. Some common causes are:
  • The entry point (procedure name), in an interaction was not found in the specified service program. Entry point names are case sensitive. If you did not specify the ExpProc keyword on the procedure interface, then the procedure name is exported as uppercase. Therefore the name must be uppercase in the interaction. If you did specify the ExpProc keyword, ensure that the value you specified in the interaction exactly matches the value specified on the ExpProc keyword. Also check that you exported the procedure name. You can see what procedures have been exported in a service program by running the iSeries command DSPSRVPGM.
  • An object required by the program could not be found. For example, the program opens a file in the library list but the file was not found. You can specify that libraries are dynamically added to the library list before the program starts. You do this by specifying library names in the iSeries Web Tools Run-time Configuration wizard.
Invalid session
This error occurs if there is no activity in the application for a certain period of time and the session times out. By default, the session time out value is 30 minutes. The session time out value is specified in the Web Deployment Description file of the application.
Note: If you make any changes to the interactions in the wizard, you must restart the application for them to take effect. To restart the application, right-click the server name in the Server view, select Restart Project, then select the application name. Wait until the message Application started: appears in the console before running the application.