ClassNotFoundException and AJ07 running CICS Java application after copying a JAR from a PC to a mainframe

Technote (troubleshooting)


Problem(Abstract)

You receive an abend AJ07 with ClassNotFoundException when trying to run a Java™ application using CICS Transaction Server. The class that the JVM can not find is in a JAR file that you create with VisualAge for Java on your PC. You use FTP to transfer the JAR file from your PC directly into the to the hierarchical file system (HFS) on the mainframe.

Symptom

You also try to use IND$FILE to send the JAR file to the mainframe and then use TSO ISHELL to copy it to the HFS.

Even though you receive the abend AJ07, the JAR file can still be read by the OMVS jar command jar tf jar-file.jar. The JVM can also successfully load the class from the HFS if the JAR is unpacked.


Cause

By default, FTP opens the data connection in ASCII mode instead of binary mode and IND$FILE creates the dataset on the mainframe with RECFM=FB and LRECL=80.

Resolving the problem

If using FTP, specify binary when doing the transfer of the JAR. Following is an example of the commands you can enter from Windows® to copy a file directly from your PC into the HFS:

  1. Start a Windows command prompt.

  2. Enter cd dir-name to the directory containing the jar file.

  3. Enter ftp ip-address to connect to your Host. You can enter netstat home from TSO to find out your host ip-address. It will be the first ip-address listed

  4. Enter your userid to logon. You might have to enter user userid.

  5. Enter your password.

  6. Enter bin so that the file transfer will be done in binary.

  7. Enter cd dir-name where dir-name is the directory name on the Host . For example, cd /u/userid/test/directory.

  8. Enter put jar-name.jar to copy the JAR into the HFS from your PC.

  9. Enter quit to exit FTP

If using IND$FILE, pre-allocate a dataset on the mainframe with RECFM=VB and LRECL=256 before entering the send command. Also, ensure that you specify binary if using TSO ISHELL to copy the JAR file into the HFS.

Here is what the Data Set Information when viewed with TSO option 3.4 should look like:
Data Set Name . . . . : USERID.TEST.JAR
General Data
  Management class . . : E02YBYRY
  Storage class  . . . : STANDARD
   Volume serial . . . : P1P110
   Device type . . . . : 3390
   Data class . . . .  : **None**
   Organization  . . . : PS
   Record format . . . : VB
   Record length . . . : 256
   Block size  . . . . : 6233
   1st extent tracks . : 1
   Secondary tracks  . : 1
   Data set name type  :
   Creation date . . . : 2004/09/17
   Expiration date . . : ***None***

Product Alias/Synonym

CICS/TS CICS TS CICS Transaction Server

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

CICS Transaction Server
Java

Software version:

3.1, 3.2, 4.1, 4.2, 5.1

Operating system(s):

z/OS

Reference #:

1179379

Modified date:

2014-01-08

Translate my page

Machine Translation

Content navigation