JZOS: CLASSPATH does not get set to jzos.jar

General discussion on the JZOS batch launcher and toolkit
Post Reply
Cogito-Ergo-Sum
Posts: 30
Joined: Thu Jan 25, 2007 8:31 am
Location: Bengaluru, India

JZOS: CLASSPATH does not get set to jzos.jar

Post by Cogito-Ergo-Sum »

Hi,
With JZOS, whenever I try to invoke a class other than com.dovetail.jzos.sample.HelloWorld, I always get a Class not found error for com.dovetail.jzos.ZUtil. This is because, I can see that the CLASSPATH variable is not set to jzos.jar. Interestingly, it DOES get set to jzos.jar when I am invoking com.dovetail.jzos.sample.HelloWorld ! I have not done any changes anywhere and yet, I do not understand, why/how the CLASSPATH does not get set.

I came across this post : RC 121 which mentions about file permissions to the directory holding jzos.jar. While I have ensured that the permissions are as required, I do not think, this is admissible. Because, the same STDENV works correctly when running the sample.

What am I missing ?
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
--Sherlock Holmes
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

Run your job again with LOGLVL='+I' and post the results here.

Also, run
<JAVA_HOME>/bin/java -version
and post those results.

It looks as if you are running an old version of JZOS - you should consider adopting the version included in recent releases of the SDK.
Cogito-Ergo-Sum
Posts: 30
Joined: Thu Jan 25, 2007 8:31 am
Location: Bengaluru, India

Post by Cogito-Ergo-Sum »

Hi Steve,
The JDK is 31-bit 1.5.0.
Here is the trace when I run com.dovetail.jzos.sample.HelloWorld :

Code: Select all

1
 JZOSVM50(N): log level has been set to: I
 JZOSVM50(N): Copyright (C) IBM Corp. 2006. All rights reserved.
 JZOSVM50(N): Version 1.2.5
 JZOSVM50(I): Region requested = 512M, Actual below/above limit = 7232K / 505M
 JZOSVM50(I): MAIL=/usr/mail/
 JZOSVM50(I): JAVA_PROPAGATE=NO
 JZOSVM50(I): PATH=/bin:/MVSPP/lpp/java/J5.0/bin:
 JZOSVM50(I): _C89_OPTIONS=-Wl,compat=unspec
 JZOSVM50(I): IBM_JAVA_ZOS_TDUMP=NO
 JZOSVM50(I): JZOS_HOME=/u/userid/jzos
 JZOSVM50(I): IBM_JAVA_OPTIONS=-Xms16m -Xmx128m -Djzos.home=/u/userid/jzos
 JZOSVM50(I): _CXX_PLIB_PREFIX=SYS1
 JZOSVM50(I): _ICONV_UCS2_PREFIX=SYS1
 JZOSVM50(I): _C89_SSYSLIB=SYS1.SCEEMAC:SYS1.MACLIB
 JZOSVM50(I): _CC_PLIB_PREFIX=SYS1
 JZOSVM50(I): _=/bin/env
 JZOSVM50(I): CLASSPATH=/u/userid/class:/u/userid/jzos/jzos.jar:
 JZOSVM50(I): LANG=C
 JZOSVM50(I): _CXX_OPTIONS=-Wl,compat=unspec
 JZOSVM50(I): LIBPATH=/lib:/usr/lib:/MVSPP/lpp/java/J5.0/bin:/MVSPP/lpp/java/J5.0/bin/classic:/u/userid/jzos:
 JZOSVM50(I): JZOS_OUTPUT_ENCODING=Cp1047
 JZOSVM50(I): _CC_OPTIONS=-Wl,compat=unspec
 JZOSVM50(I): HOME=/u/userid
 JZOSVM50(I): JAVA_DUMP_HEAP=false
 JZOSVM50(I): _C89_PLIB_PREFIX=SYS1
 JZOSVM50(I): JAVA_HOME=/MVSPP/lpp/java/J5.0
 JZOSVM50(I): TZ=PST8PDT
 JZOSVM50(I): MANPATH=/usr/man/%L
 JZOSVM50(I): NLSPATH=/usr/lib/nls/msg/%L/%N
 JZOSVM50(I): PWD=/u/userid
 JZOSVM50(I): Setting current working dir to: "/u/userid"
 JZOSVM50(N): Java Virtual Machine created.  Version information follows:
 java version "1.5.0"
 Java(TM) 2 Runtime Environment, Standard Edition (build pmz31dev-20061002b (SR3))
 IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 z/OS s390-31 j9vmmz3123-20061002 (JIT enabled)
 J9VM - 20060915_08260_bHdSMr
 JIT  - 20060908_1811_r8
 GC   - 20060906_AA)
 JZOSVM50(I): Using output encoding: 'Cp1047'
 JZOSVM50(I): MVS commands are ENABLED
 JZOSVM50(I): Java main class: com.dovetail.jzos.sample.HelloWorld
 JZOSVM50(N): Invoking com.dovetail.jzos.sample.HelloWorld.main()
 JZOSVM50(N): com.dovetail.jzos.sample.HelloWorld.main() completed.
 JZOSVM50(I): Waiting for non-deamon Java threads to finish before exiting...
 JZOSVM - JVM completed with exit(0).
This is the trace when I run a different class :

Code: Select all

1
 JZOSVM50(N): log level has been set to: I
 JZOSVM50(N): Copyright (C) IBM Corp. 2006. All rights reserved.
 JZOSVM50(N): Version 1.2.5
 JZOSVM50(I): Region requested = 512M, Actual below/above limit = 7232K / 505M
 JZOSVM50(I): MAIL=/usr/mail/
 JZOSVM50(I): JAVA_PROPAGATE=NO
 JZOSVM50(I): PATH=/bin:/MVSPP/lpp/java/J5.0/bin:
 JZOSVM50(I): _C89_OPTIONS=-Wl,compat=unspec
 JZOSVM50(I): IBM_JAVA_ZOS_TDUMP=NO
 JZOSVM50(I): JZOS_HOME=/u/userid/jzos
 JZOSVM50(I): IBM_JAVA_OPTIONS=-Xms16m -Xmx128m -Djzos.home=/u/userid/jzos
 JZOSVM50(I): _CXX_PLIB_PREFIX=SYS1
 JZOSVM50(I): _ICONV_UCS2_PREFIX=SYS1
 JZOSVM50(I): _C89_SSYSLIB=SYS1.SCEEMAC:SYS1.MACLIB
 JZOSVM50(I): _CC_PLIB_PREFIX=SYS1
 JZOSVM50(I): _=/bin/env
 JZOSVM50(I): CLASSPATH=/u/userid/class:/u/userid/jzos/*.jar:
 JZOSVM50(I): LANG=C
 JZOSVM50(I): _CXX_OPTIONS=-Wl,compat=unspec
 JZOSVM50(I): LIBPATH=/lib:/usr/lib:/MVSPP/lpp/java/J5.0/bin:/MVSPP/lpp/java/J5.0/bin/classic:/u/userid/jzos:
 JZOSVM50(I): JZOS_OUTPUT_ENCODING=Cp1047
 JZOSVM50(I): _CC_OPTIONS=-Wl,compat=unspec
 JZOSVM50(I): HOME=/u/userid
 JZOSVM50(I): JAVA_DUMP_HEAP=false
 JZOSVM50(I): _C89_PLIB_PREFIX=SYS1
 JZOSVM50(I): JAVA_HOME=/MVSPP/lpp/java/J5.0
 JZOSVM50(I): TZ=PST8PDT
 JZOSVM50(I): MANPATH=/usr/man/%L
 JZOSVM50(I): NLSPATH=/usr/lib/nls/msg/%L/%N
 JZOSVM50(I): PWD=
 JZOSVM50(I): Setting current working dir to: ""
 JZOSVM50(W): Could not set current directory to:
 atoe_getcwd error: EDC5134I Function not implemented.
 atoe_getcwd error: EDC5134I Function not implemented.
 atoe_getcwd error: EDC5134I Function not implemented.
 atoe_getcwd error: EDC5134I Function not implemented.
 atoe_getcwd error: EDC5134I Function not implemented.
 JZOSVM50(N): Java Virtual Machine created.  Version information follows:
 Could not find Class com.dovetail.jzos.ZUtil
  
 Exception in thread "main"
 JZOSVM50(I): Calling System.exit()...
 JZOSVM - failed.  RC=121.
Note the CLASSPATH values in both cases. That is the difference I was referring to.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
--Sherlock Holmes
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Was the second job run under a different z/OS userid?

I ask because I notice that the variable PWD is empty in the second job, and that you are getting errors trying to set the home directory. If you are running the second job under a different userid, be sure that it has a good USS segment in RACF, with a valid home directory.
Cogito-Ergo-Sum
Posts: 30
Joined: Thu Jan 25, 2007 8:31 am
Location: Bengaluru, India

Post by Cogito-Ergo-Sum »

I did notice the PWD thing !
If you are running the second job under a different userid, be sure that it has a good USS segment in RACF, with a valid home directory.
No, I am not. In SDSF, I give a SJ against the successfully completed job, change the class name and resubmit. That is all.

I tried with a explicit export PWD. In this case, too, I get this message :

Code: Select all

JVMJZBL1006I PWD = /u/userid/                              
JVMJZBL2999T Setting current working dir to: "/u/userid/"  
JVMJZBL2999W Could not set current directory to: /u/userid/
I am checking with ppl here if there is anything that I need to do to ensure that this system that I am working behvaes predictably !
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
--Sherlock Holmes
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

From your output in the first case, you are running SDK 5.0 SR3. This release of the SDK contains JZOS as a built-in feature. However, you appear to be trying to use the 1.2.5 version of JZOS from alphaWorks.

Since you have a JZOS enabled SDK already, you should be using that version. Note that the package names have changed in the product version; so for example, the class com.dovetail.jzos.sample.HelloWorld now becomes com.ibm.jzos.sample.HelloWorld.

In order to use the SDK version of JZOS, you'll need to switch over to the new load library (found at <JAVA_HOME>/mvstools/JVMLDM50 and use the sample JCL provided at <JAVA_HOME>mvstools/samples/jcl

You can find detailed instructions here (look for the section labeled "optional install"):

http://www-03.ibm.com/servers/eserver/z ... eadme.html
Post Reply