Could not find Class com.dovetail.jzos.ZUtil

General discussion on the JZOS batch launcher and toolkit
Post Reply
Søren

Could not find Class com.dovetail.jzos.ZUtil

Post by Søren »

Hi

I get "Could not find Class com.dovetail.jzos.ZUtil" error when I run the RUN13 sample with com.dovetail.jzos.testing.HelloWorld.

Running with log level T I can see that the classpath is ok:

CLASSPATH=/home/e36741:/home/e36741/jzos/jzos110/junit.jar:/home/e36741/jzos/jzos110/jzos.jar:/home/e36741/jzos/jzos110/jzos_log4j.jar:

I have no problems running com.dovetail.jzos.testing.HelloWorld from the unix shell.

Any suggestions would be appreciated.

Regards
Søren Hartvig[/code]
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Please check that the LIBPATH also points to where you have installed jzos native binaries (.so files). You will get a JVM "Class not found error" if the class can't be loaded because of a missing native library.

If that's not the problem, please post the entire contents of your job's output from the //SYSOUT DD, and we'll take a look.

Kirk
Guest

Post by Guest »

The libpahh should be ok.

LIBPATH=/usr/lpp/internet/bin:/lib:/usr/lib:/usr/lpp/internet/sbin:/usr/lpp/TextTools/lib:/usr/lpp/java/IBM/J1.3/bin:/usr/lpp/java/IBM/J1.3/bin/classic:/home/e36741/jzos/jzos110:

I will mail the entire trace file.

/søren
Guest

Post by Guest »

Thank you for sending the information.
In the trace your sent, we are seeing the following error:

Class missing for error: java/lang/VerifyError at com.dovetail.jzos.ZUtil.getEnv(Native Method)

The JZOS batch launcher is using JNI to load and execute this method, which is in jzos.jar. The ZUtil class itself is a JNI wrapper and therefore loads a native library.

I think that it is finding the method in the jar, but maybe the JNI native library is a backlevel version of the jzos jni library. Another possibility is that the jar is corrupted, but I don't think that is the case, since you were able to run the HelloWorld from a shell, which is a class in the same Jar.

So, here are my suggestions:

1) Make sure that you don't have mixed versions of the JZOS code - this includes the JZOSVMXX load module, the jars, and the native library.

2) Write a simple test Java program that simply has a main method with the line:

System.out.println(ZUtil.getEnv("CLASSPATH"));

Run this program from a shell. This will verify that the jzos.jar ZUtil class and its native library are good.
Guest

Post by Guest »

Did you find the problem? Let us know if you found the problem; maybe we can add something to the documentation to avoid the situation in the future.
jdmedlock
Posts: 2
Joined: Wed Mar 02, 2005 9:54 am

Post by jdmedlock »

After installing JZOS I'm receiving the following message when I attempt to execute the test RUN13.

"Could not find Class com.dovetail.jzos.ZUtil"

I'm not sure how to fix this, do you have any suggestions? Any help will be appreciated. I'm including copies of my proc, jcl and trace below.

Thanks,
Jim

EXJZOVM:
======
//*********************************************************************
//*
//* Stored procedure for executing the JZOS Java Batch Launcher
//*
//* Tailor the proc your installation:
//* 1.) Replace 'S99710.JZOS.LOADLIB' with the PDSE that contains the
//* JZOSVMxx modules that were installed during installation
//*
//*********************************************************************
//EXJZOSVM PROC JAVACLS=, < Fully Qfied Java class..RQD
// ARGS=, < Args to Java class
// LIBRARY='S99710.JZOS.LOADLIB', < STEPLIB FOR JZOSVM module
// VERSION='13', < Version of JZOSVM module
// LOGLVL='+T', < Debug LVL: +I(info) +T(trc)
// REGSIZE='0M', < EXECUTION REGION SIZE
// LEPARM=''
//JAVAJVM EXEC PGM=JZOSVM&VERSION,REGION=&REGSIZE,
// PARM='&LEPARM/&LOGLVL &JAVACLS &ARGS'
//STEPLIB DD DSN=&LIBRARY,DISP=SHR
//SYSPRINT DD SYSOUT=* < System stdout
//SYSOUT DD SYSOUT=* < System stderr
//STDOUT DD SYSOUT=* < Java System.out
//STDERR DD SYSOUT=* < Java System.err
//CEEDUMP DD SYSOUT=*
//ABNLIGNR DD DUMMY
//*
//*The following DDs can/should be present in the calling JCL
//*
//*STDIN DD < OPTIONAL - Java System.in
//*STDENV DD < REQUIRED - JVM Environment script
//*MAINARGS DD < OPTIONAL - Alternate method to supply args
// PEND

RUN13:
====
//S99710L JOB (' ',SYS1,,,,UMS),'JIM MEDLOCK',
// CLASS=A,MSGCLASS=T,NOTIFY=S99710
//PROCLIB JCLLIB ORDER=S99710.JZOS.SAMPJCL
//*
//*********************************************************************
//*
//* Batch job to run the Java1.3 VM
//*
//* Tailor the proc and job for your installation:
//* 1.) Modify the Job card per your installation's requirements
//* 2.) Modify the PROCLIB card to point to this PDS, or wherever
//* the EXJZOSVM procedures has been installed.
//* 3.) Modify JZOS_HOME to point to the hfs directory where JZOS
//* was installed
//* 4.) edit JAVA_HOME to point the location of the 1.3 JDK
//* 5.) Modify the CLASSPATH as required to point to your Java code
//* 6.) Modify JAVACLS and ARGS to launch desired Java class
//*
//*********************************************************************
//*
//JAVA EXEC PROC=EXJZOSVM,VERSION='13',
// JAVACLS='HW'
//STDENV DD *



. /etc/profile
export JZOS_HOME=/U/S99710/JZOS
export JAVA_HOME=/usr/lpp/java/IBM/J1.3

export PATH="$PATH":"${JAVA_HOME}"/bin:

LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
LIBPATH="$LIBPATH":"${JZOS_HOME}"
export LIBPATH="$LIBPATH":


CLASSPATH=/u/s99710


for i in "${JZOS_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":










IJO="-Xms16m -Xmx128m"
IJO="$IJO -Djzos.home=${JZOS_HOME}"


export IBM_JAVA_OPTIONS="$IJO "

export JAVA_DUMP_HEAP=false
export JAVA_PROPAGATE=NO
export IBM_JAVA_ZOS_TDUMP=NO
//

Trace output:
========
1
02:50:45 JZOSVM13(N): log level has been set to: T
02:50:45 JZOSVM13(T): -> JzosVM()
02:50:45 JZOSVM13(N): Copyright (C) 2004 Dovetailed Technologies LLC. All rights reserved.
02:50:45 JZOSVM13(N): JZOS Version 1.1.1
02:50:45 JZOSVM13(T): <- JzosVM()
02:50:45 JZOSVM13(T): -> run()
02:50:45 JZOSVM13(I): Region requested = 0K, Actual below/above limit = 8M / 1901M
02:50:45 JZOSVM13(T): -> adoptEnvironment()
02:50:46 JZOSVM13(T): Writing shell script to child's stdin:
02:50:46 JZOSVM13(T): # This is a shell script which configures
02:50:46 JZOSVM13(T): # any environment variables for the Java JVM.
02:50:46 JZOSVM13(T): # Variables must be exported to be seen by the launcher.
02:50:46 JZOSVM13(T): . /etc/profile
02:50:46 JZOSVM13(T): export JZOS_HOME=/U/S99710/JZOS
02:50:46 JZOSVM13(T): export JAVA_HOME=/usr/lpp/java/IBM/J1.3
02:50:46 JZOSVM13(T):
02:50:46 JZOSVM13(T): export PATH="$PATH":"${JAVA_HOME}"/bin:/u/s99710
02:50:46 JZOSVM13(T):
02:50:46 JZOSVM13(T): LIBPATH="$LIBPATH":/u/s99710
02:50:46 JZOSVM13(T): LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin
02:50:46 JZOSVM13(T): LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
02:50:46 JZOSVM13(T): LIBPATH="$LIBPATH":"${JZOS_HOME}"
02:50:46 JZOSVM13(T): export LIBPATH="$LIBPATH":
02:50:46 JZOSVM13(T):
02:50:46 JZOSVM13(T): # Customize your CLASSPATH here
02:50:46 JZOSVM13(T): CLASSPATH=/u/s99710
02:50:46 JZOSVM13(T):
02:50:46 JZOSVM13(T): # Add JZOS required jars to end of CLASSPATH
02:50:46 JZOSVM13(T): for i in "${JZOS_HOME}"/*.jar; do
02:50:46 JZOSVM13(T): CLASSPATH="$CLASSPATH":"$i"
02:50:46 JZOSVM13(T): done
02:50:46 JZOSVM13(T): export CLASSPATH="$CLASSPATH":
02:50:46 JZOSVM13(T):
02:50:46 JZOSVM13(T): # Set JZOS specific options
02:50:46 JZOSVM13(T): # Use this variable to specify encoding for DD STDOUT and STDERR
02:50:46 JZOSVM13(T): #export JZOS_OUTPUT_ENCODING=Cp1047
02:50:46 JZOSVM13(T): # Use this variable to prevent JZOS from handling MVS operator commands
02:50:46 JZOSVM13(T): #export JZOS_ENABLE_MVS_COMMANDS=false
02:50:46 JZOSVM13(T): # Use this variable to supply additional arguments to main
02:50:46 JZOSVM13(T): #export JZOS_MAIN_ARGS=""
02:50:46 JZOSVM13(T):
02:50:46 JZOSVM13(T): # Configure JVM options
02:50:46 JZOSVM13(T): IJO="-Xms16m -Xmx128m"
02:50:46 JZOSVM13(T): IJO="$IJO -Djzos.home=${JZOS_HOME}"
02:50:46 JZOSVM13(T): # Uncomment the following if you want to run with Ascii file encoding..
02:50:46 JZOSVM13(T): #IJO="$IJO -Dfile.encoding=ISO8859-1"
02:50:46 JZOSVM13(T): export IBM_JAVA_OPTIONS="$IJO "
02:50:46 JZOSVM13(T):
02:50:46 JZOSVM13(T): export JAVA_DUMP_HEAP=false
02:50:46 JZOSVM13(T): export JAVA_PROPAGATE=NO
02:50:46 JZOSVM13(T): export IBM_JAVA_ZOS_TDUMP=NO
02:50:46 JZOSVM13(T): waiting for child
02:50:48 JZOSVM13(T): child process exited with exit code 0
02:50:48 JZOSVM13(D): Output from DD:STDENV config shell script:
02:50:48 JZOSVM13(T): Found environment start string
02:50:48 JZOSVM13(D): ___JZOS_ENV_START___
02:50:48 JZOSVM13(I): MAIL=/usr/mail/
02:50:48 JZOSVM13(I): JAVA_PROPAGATE=NO
02:50:48 JZOSVM13(I): PATH=/bin:/usr/lpp/Printsrv/bin:/usr/lpp/java/IBM/J1.3/bin:usr/lpp/db2/db2710/bin:.:/usr/lpp/java/
IBM/J1.3/bin:/u/s99710
02:50:48 JZOSVM13(I): IBM_JAVA_ZOS_TDUMP=NO
02:50:48 JZOSVM13(I): JZOS_HOME=/U/S99710/JZOS
02:50:48 JZOSVM13(I): IBM_JAVA_OPTIONS=-Xms16m -Xmx128m -Djzos.home=/U/S99710/JZOS
02:50:48 JZOSVM13(I): LD_LIBRARY_PATH=/usr/lpp/db2/db2710/lib
02:50:48 JZOSVM13(I): _=/bin/env
02:50:48 JZOSVM13(I): CLASSPATH=/u/s99710:/U/S99710/JZOS/*.jar:
02:50:48 JZOSVM13(I): LANG=C
02:50:48 JZOSVM13(I): LIBPATH=/lib:/usr/lib:/bin:/usr/lpp/java/IBM/J1.3/lib:/usr/lpp/db2/db2710/lib:/usr/lpp/Printsrv/li
b:.:/u/s99710:/usr/lpp/java/IBM/J1.3/bin:/usr/lpp/java/IBM/J1.3/bin/classic:/U/S99710/JZOS:
02:50:48 JZOSVM13(I): JAVA_DUMP_HEAP=false
02:50:48 JZOSVM13(I): JAVA_HOME=/usr/lpp/java/IBM/J1.3
02:50:48 JZOSVM13(I): TZ=EST5EDT
09:50:48 JZOSVM13(I): MANPATH=/usr/man/%L:/usr/lpp/Printsrv/man/%L
09:50:48 JZOSVM13(I): NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lpp/Printsrv/%L/%N
09:50:48 JZOSVM13(D): ___JZOS_ENV_STOP___
09:50:48 JZOSVM13(T): <- adoptEnvironment()
09:50:48 JZOSVM13(T): processing argv[2]: HW
09:50:48 JZOSVM13(T): javaArgCount after processing PARMS: 1
09:50:48 JZOSVM13(T): -> processExtraArgs()
09:50:48 JZOSVM13(T): No JZOS_MAIN_ARGS found
09:50:48 JZOSVM13(T): NO //DD:MAINARGS found
09:50:48 JZOSVM13(D): argBuf=''
09:50:48 JZOSVM13(T): <- processExtraArgs()
09:50:48 JZOSVM13(T): -> initializeVMArgs()
09:50:48 JZOSVM13(T): vm_args.version: 10002
09:50:49 JZOSVM13(T): Allocating JVM options
09:50:49 JZOSVM13(T): Setting exit hook option
09:50:49 JZOSVM13(T): Setting abort hook option
09:50:49 JZOSVM13(T): Getting CLASSPATH
09:50:49 JZOSVM13(T): Setting classpath option
09:50:49 JZOSVM13(T): <- initializeVMArgs()
09:50:49 JZOSVM13(T): -> createJvm()
09:50:50 JZOSVM13(N): Java Virtual Machine created. Version information follows:
09:50:50 JZOSVM13(T): -> invoke()
Could not find Class com.dovetail.jzos.ZUtil

Exception in thread "main"
09:50:52 JZOSVM13(T): <- invoke()
09:50:52 JZOSVM13(T): <- createJvm()
09:50:52 JZOSVM13(T): <- run()
09:50:52 JZOSVM13(T): -> cleanup()
09:50:52 JZOSVM13(I): Preparing to exit JVM...
09:50:52 JZOSVM13(T): -> invoke()
09:50:52 JZOSVM13(D): About to invoke java.lang.System.exit()
JZOSVM - failed. RC=121.

*** end of post ***
coz
Posts: 392
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

I think that problem is that your JZOS_HOME variable is not pointing to the JZOS HFS home directory. In your //STDENV config script, you have:

export JZOS_HOME=/U/S99710/JZOS

I assume that this is not really all upper-case, and it should really say something like:

export JZOS_HOME=/u/s99710/jzos

BTW: Its not "finding" the ZUtil class because the required JZOS JNI library can't be found in your LIBPATH.

Hope this helps....
jdmedlock
Posts: 2
Joined: Wed Mar 02, 2005 9:54 am

Post by jdmedlock »

Sometimes is the simple things that trip you up!!! Changing the JZOS_HOME value to lowercase fixed the problem.

Thanks for the quick response.
Post Reply