JZOS FileNotFoundException on jar

General discussion on the JZOS batch launcher and toolkit
Post Reply
tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

JZOS FileNotFoundException on jar

Post by tsdjim » Wed Nov 11, 2015 8:02 am

I created a jar file using cf ShowEncoding.jar ShowEncoding.class

When I try to execute it using JZOS, I get FileNotFoundException.
The jar is in the path /u/try. Part of the JCL is given below.
If I replace the jar with the class file, it works fine. Some trace items follow.


// JCLLIB ORDER=SYS1.PROCLIB
//JAVA EXEC PROC=JVMPRC70,
// JAVACLS='-jar ShowEncoding.jar',LOGLVL='+T'
//STDENV DD *
. /etc/profile
export JAVA_HOME=/usr/lpp/java/J7.0
export PATH=/bin:"$ºJAVA_HOME¿"/bin:"/u/try"
LIBPATH=/lib:/usr/lib:"$ºJAVA_HOME¿"/bin
LIBPATH="$LIBPATH":"$ºJAVA_HOME¿"/lib/s390
LIBPATH="$LIBPATH":"$ºJAVA_HOME¿"/lib/s390/j9vm
LIBPATH="$LIBPATH":"$ºJAVA_HOME¿"/bin/classic
LIBPATH="$LIBPATH":"/u/try"
export LIBPATH="$LIBPATH":

# Customize your CLASSPATH here
APP_HOME="/u/try"
CLASSPATH=$APP_HOME:"$ºJAVA_HOME¿"/lib:"$ºJAVA_HOME¿"/lib/ext

# Add Application required jars to end of CLASSPATH
for i in "$ºAPP_HOME¿"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
......
.........

JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T <- establishMvsCommandListener()
JVMJZBL2999T -> invokeMain()
JVMJZBL2999T -> getMainClassFromJarFile()
JVMJZBL2999T jarfile: ShowEncoding.jar
class load: java/io/FileNotFoundException from: /usr/lpp/java/J7.0/lib/rt.jar
JVMJZBL1050E Error reading jarfile "ShowEncoding.jar" for -jar option
JVMJZBL2999T -> JniUtil.writeStackTrace()
class load: java/io/PrintWriter from: /usr/lpp/java/J7.0/lib/rt.jar
class load: java/util/Collections$EmptyIterator from: /usr/lpp/java/J7.
JVMJZBL2007E Stack trace follows:
java.io.FileNotFoundException: ShowEncoding.jar (EDC5129I No such file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:229)
at java.util.zip.ZipFile.<init>(ZipFile.java:159)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:103)

dovetail
Site Admin
Posts: 1839
Joined: Thu Jul 29, 2004 12:12 pm

Re: JZOS FileNotFoundException on jar

Post by dovetail » Wed Nov 11, 2015 3:00 pm

Is the home directory /u/try?

Otherwise, try: '-jar /u/try/ShowEncoding.jar'

tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

Re: JZOS FileNotFoundException on jar

Post by tsdjim » Thu Nov 12, 2015 2:42 am

If I use '-jar /u/try/ShowEncoding.jar' it works. I don't know why it does not take the jar from the
CLASSPATH.

This is the quote from the JZOS Batch Launcher manual:
"An executable JAR file may be launched by specifying "-jar <jar file name>" in
place of a main class name. This behaves the same as the "-jar" option on the java
shell command launcher - the MANIFEST entry is read from named jar file to find
the main class name."

Post Reply