General Page
Client/Server Communication
- Is there an active TCP/IP connection between your client and IBM i system that is not blocked by a firewall? 'Ping' your IBM i system from your workstation to see if the connection is active. Also 'ping' your workstation from the IBM i system. The Toolbox also provides a class called JPing, in the utilities package, which can be used to determine if a TCP/IP connection can be made to the IBM i host servers.
- Are the IBM i host servers started ? The IBM Toolbox for Java classes use the IBM i host servers as the access point to IBM i data. Use "STRHOSTSVR *ALL" from an IBM i command prompt to start the servers. The file and database servers run in the QSERVER subsystem. If not already started, run "STRSBS QSERVER" from an IBM i command prompt to start the subsystem before starting the servers. Use "STRTCPSVR *DDM" from an IBM i command prompt to start the DDM server, which is used by Record Level Access classes such as KeyedFile and SequentialFile.
- Is the QUSER user profile enabled and does it have a valid password? The IBM i host servers pre-started jobs begin under the QUSER profile. Once the Toolbox connects to the host server, the server job swaps to the user profile supplied by the Java program or entered on the toolbox sign-on dialog. QUSER must be enabled and have a valid password.
JDBC
- Does your program receive exception "No suitable driver found" when it tries to access an IBM i database?
You must you register the IBM Toolbox for Java JDBC driver with the DriverManager class. To register the driver add
DriverManager.registerDriver(new
com.ibm.as400.access.AS400JDBCDriver());
to your program, or add com.ibm.as400.access.AS400JDBCDriver
to the JDBC.drivers property.
Class.forName(new com.ibm.as400.access.AS400JDBCDriver()) does not register the JDBC driver on some JVMs. See Sun's JDBC FAQ for more details.
- Does your program receive "com.ibm.as400.access.AS400JDBCException: [PWS0001] Function did not complete successfully" when it accesses an IBM i database file?
Make sure the latest IBM i database server PTFs are applied to the IBM i system. This message usually indicates an error in the database server. - Does your program fail when it tries to execute a stored procedure using the Toolbox JDBC driver? Does your program receive "java.sql.SQLException: Descriptor index not valid"?
- Make sure the procedure exists on the IBM i.
- For the location of the procedure, make sure the schema name is used, not the library name.
- Make sure the procedure being called does not expect input parameters.
Record-Level access
- The record-level access classes will not function if the host servers aren't started on the IBM i system. Run "STRHOSTSVR SERVER(*ALL)" from an IBM i command prompt to start the servers.
- The record-level access classes will not function if the DDM server is not started on the IBM i system. Run "STRTCPSVR SERVER(*DDM)" from an IBM i command prompt to start the server.
- The record-level access classes will not function if the "DDM Request Access" network attribute is set to *REJECT. Run "DSPNETA" from an IBM i command prompt to make sure this attribute is set to *OBJAUT.
- By default, the record-level access server runs in the QSYSWRK subsystem. Run "STRSBS QCMN" from an IBM i command prompt to start the server.
- When using KeyedFile, the key value for character fields that are not variable length must be blank padded to the fixed length of the field.
Integrate file system
What object types in the QSYS.LIB directory can be manipulated? In general, the file server on IBM i does not allow objects in the QSYS.LIB file system to be opened for data access. The contents of these objects (such as user profiles, job descriptions, data queues, device descriptions, etc.) cannot be read or written. The exception is source physical file members and user spaces. The data in these two types of objects can be read and written.
Java related
- If accessing the class files from a Java program, jt400.jar must be in your classpath.
- When running an applet in a browser, do you see error java.io.FileNotFoundException for "/com/ibm/as400/access/MRI.class"? You can ignore this error. The Toolbox uses property resource bundles for its messages. When the Toolbox loads its messages, the browser first tries to find file MRI.class before it looks for MRI.properties. The messages are in MRI.properties. The Toolbox will function properly even though the error is displayed.
Was this topic helpful?
Document Information
Modified date:
05 March 2020
UID
ibm15692700