IBM Support

Using the JPing Utility

Troubleshooting


Problem

This document describes the JPing utility, which is part of the IBM Toolbox for Java.

Diagnosing The Problem

The IBM Toolbox for Java can make connections to one or several TCP/IP ports on the IBM i host system. If there are network problems, such as a firewall blocking a required port, or a required server not started on IBM i, connection failures can result in the Java program. An example connection failure might be:

java.sql.SQLException: The application requester cannot establish the connection. (Connection timed out) DSRA0010E: SQL State = 08001, Error Code = -99,999

The IBM Toolbox for Java includes a utility that can be used to test connections to the various ports used by this package. Starting with JTOpen version 7.1, the IBM Toolbox for Java JPing utility was enhanced.  It does not halt on the first connection failure, and verbose mode was added as an option to display the details about the connection being attempted. To run a comprehensive connection test to an IBM i System named "MY_SYSTEM" using version 7.1 or later of the IBM Toolbox for Java, invoke the utility like this:
java -cp ./jt400.jar utilities.JPing MY_SYSTEM -v

When you run JPing on an IBM i system, the following command is used to perform the same task:
JAVA CLASS('utilities.JPing') PARM('localhost' '-v') CLASSPATH('/qibm/proddata/HTTP/Public/jt400/lib/jt400.jar')


The following help text is displayed when the utility is invoked without any arguments:

IBM Toolbox for Java:
Open Source Software, JTOpen 9.0, codebase 5770-SS1 V7R3M0.00 built=20160330 @Q10
Supports JDBC version 3.0
Toolbox driver version 11.0

C:\>java utilities.JPing

USAGE: java utilities.JPing [-h] <systemName> [-service <service>] [-ssl] [-verbose]

[-h | -help]        Help
[-service | -s]     Service: as-file, as-netprt, as-rmtcmd,
                             as-dtaq, as-database, as-ddm,
                             as-central, as-signon
[-ssl]              Use SSL ports
[-timeout | -t]     Timeout period in milliseconds.  Default is 20000 (20 seconds).
[-verbose | -v]     Generate verbose output.

Resolving The Problem


Determining the version of IBM Toolbox for Java

Starting with the versions of IBM Toolbox for Java complied with Java 9 and later, the utilities are located in the path com.ibm.as400.util. There is a simple-to-use utility to report the version of IBM Toolbox for Java jt400.jar file. From the directory where the jt400.jar file resides, run this command:
java -cp ./jt400.jar utilities.AboutToolbox
The command produces output like the following:

IBM Toolbox for Java:
Open Source Software, JTOpen 9.0, codebase 5770-SS1 V7R3M0.00 built=20160330 @Q10
Supports JDBC version 3.0
Toolbox driver version 11.0


This example shows a JTOpen version of 9.0 from the lib directory that is the version that supports the older JDBC version 3.0.
Running this command against the JAR file in the lib\java6 directory yields slightly different output showing that this version supports JDBC version 4.0:

IBM Toolbox for Java:
Open Source Software, JTOpen 9.0, codebase 5770-SS1 V7R3M0.00 built=20160330 @Q10
Supports JDBC version 4.0
Toolbox driver version 11.0


Similarly, the version in the lib\java8 directory reports that it supports JDBC version 4.2:

IBM Toolbox for Java:
Open Source Software, JTOpen 9.0, codebase 5770-SS1 V7R3M0.00 built=20160330 @Q10
Supports JDBC version 4.2
Toolbox driver version 11.0
The same command run against the lib\java9\jt400.jar file produces a java.lang.NoClassDefFoundError exception.  For these newer versions of the Jar, the command must provide a different path (package):
/QOpenSys/QIBM/ProdData/JavaVM/jdk11/64bit/bin/java -cp /QIBM/ProdData/OS400/jt400/lib/java9/jt400.jar com.ibm.as400.util.AboutToolbox
IBM Toolbox for Java:                                                            
Open Source Software, JTOpen 10.7 codebase 5770-SS1 V7R4M0.00 built=20210826 @AE8
Supports JDBC version 4.3                                                        
Toolbox driver version 12.7                                                      
NOTE:
JPing does not fully allocate the pre-start jobs that normally service each connection. In QZDASOINIT jobs, errors messages are logged:
CPE3426    Diagnostic    10   08/21/20  12:10:02.410196  QZBSCOMM     QSYS        *STMT    QZBSCOMM    QSYS        *STMT
                           From module . . . . . . . . :   QZBSCOMM
                           From procedure  . . . . . . :   SndErrnoMsg__FPc
                           Statement . . . . . . . . . :   13
                           To module . . . . . . . . . :   QZBSCOMM
                           To procedure  . . . . . . . :   SndErrnoMsg__FPc
                           Statement . . . . . . . . . :   13
                           Message . . . . :   A connection with a remote socket was reset by that
                             socket.
CPIAD08    Diagnostic    40   08/21/20  12:10:02.410219  QZBSCOMM     QSYS        *STMT    QZBSCOMM    QSYS        *STMT
                           From module . . . . . . . . :   QZBSCOMM
                           From procedure  . . . . . . :   SndCPIAD08__FiN21
                           Statement . . . . . . . . . :   38
                           To module . . . . . . . . . :   QZBSCOMM
                           To procedure  . . . . . . . :   SndCPIAD08__FiN21
                           Statement . . . . . . . . . :   38
                           Message . . . . :   Host server communications error occurred on recv() -
                             length - TCP .

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"Data Access","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Historical Number

564057641

Document Information

Modified date:
16 November 2021

UID

nas8N1012209