Skip to main content

Toolbox for Java and JTOpen

Debugging Program Calls

How do I debug a Program Call problem?

The Toolbox's Program Call component carries out its task by calling the Remote Command host server on IBM i, which is part of i5/OS option 12. This server is used by both the Toolbox and Client Access/400 to call programs on the server.

The Toolbox communicates with the server via sockets/TCP. When the Java program and the Toolbox zip/jar files are on a client, normal sockets/TCP is used to get to the server. When the Java program, the Toolbox zip/jar file and the RPG program are all on the same server, local sockets are used to call this server. This is faster than 'normal' sockets but the key point is we will do a call to the server even when everything is on the same server.

When the host servers are started, jobs are created to catch our program call requests. As you have noticed, these jobs start under profile QUSER.

When we call the host server, we supply a userid and password. The host server swaps to the profile we supply, runs the specified program, then swaps back to QUSER so it is ready to carry out the next request. The program is not run under the QUSER profile, it is run under an actual user profile. The Toolbox gets the userid/password in one of three ways:

  1. The Java program can programatically set the userid/password via methods on the AS400 object.
  2. If on a client, the Toolbox will prompt for userid/password.
  3. If on the i5/OS JVM, the Toolbox will use the userid/password of the i5/OS job the Java program is running in.

Since the server swaps to a profile other than QUSER before running the program, the library list of the user profile is in effect.

Debugging this process can be a challenge. The server puts the profile it swapped to (and additional debug information) in the job log, but finding that job log can be difficult. It is hard because the real profile does not show up on the WRKACTJOB screen. The jobs on that screen are always listed as belonging to QUSER.

Here are some debugging hints our server team has put together:

We're here to help

Easy ways to get the answers you need.


or call us at
1-866-883-8901
Priority code:
101AR13W

JTOpen/Toolbox forum

A discussion facility that puts you in touch with other users of JTOpen and the Toolbox