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:
The IBM Toolbox for Java includes a utility that can be used to test connections to the various ports used by this package. To run a comprehensive connection test to an IBM i System named "MY_SYSTEM" using the IBM Toolbox for Java, invoke the utility like this from a directory containing the jt400.jar file:
When you run JPing on an IBM i system, the following command is used to perform the same task:
The following help text is displayed when the utility is invoked without any arguments:
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. To run a comprehensive connection test to an IBM i System named "MY_SYSTEM" using the IBM Toolbox for Java, invoke the utility like this from a directory containing the jt400.jar file:
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/OS400/JT400/lib/jt400.jar')
The following help text is displayed when the utility is invoked without any arguments:
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.
The JPing tool can be used to test secure connections by making use of the -ssl optional argument. In order to use SSL or TLS with java, you must provide a java JVM property to define to the JVM the location of the truststore the JVM will use. In the following example, I make use of the truststore that was created by the IBM i Access Client Solutions client:
T:\JTOpen\JTOpen_20.0.7>java -Djavax.net.ssl.trustStore=C:\Users\mikswens\Documents\IBM\iAccessClient\Private\mikswens\cacerts -cp ./jt400-20.0.7.jar utilities.JPing RCH730b -ssl
Verifying connections to system RCH730b...
Successfully connected to server application: as-file-s
Successfully connected to server application: as-netprt-s
Successfully connected to server application: as-rmtcmd-s
Successfully connected to server application: as-dtaq-s
Successfully connected to server application: as-database-s
Successfully connected to server application: as-ddm-s
Failed to make connection to server application: as-central-s
Failed to make connection to server application: as-signon-s
Connection verify failed
For more details on using secure connections with the IBM Toolbox for Java, see Setup Instructions for Making Secure Sockets Layer (SSL) Connections with the IBM Toolbox for Java
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 .
To fully allocate a pre-start job from the IBM i command line, use jdbcClient.
Related Information
[{"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"Data Access","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB68","label":"Power HW"}}]
Historical Number
564057641
Was this topic helpful?
Document Information
Modified date:
16 October 2024
UID
nas8N1012209