Author |
Message
|
psn |
Posted: Tue Jul 13, 2004 5:33 am Post subject: java exception |
|
|
Disciple
Joined: 30 Oct 2002 Posts: 193 Location: France
|
Hi,
I have write a MQ Java Programm and try to call im from a jar file but I had the following error:
java -classpath /opt/mqsi/jre -jar com.tcoag.mqgetter.MQGetter IN
Exception in thread "main" java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:110)
at java.util.jar.JarFile.<init>(JarFile.java:115)
at java.util.jar.JarFile.<init>(JarFile.java:57)
but the java.util.* must be in the rt.jar !!! Why this error and how to corret it ?
PSN |
|
Back to top |
|
 |
MQGuy2000 |
Posted: Tue Jul 13, 2004 5:44 am Post subject: |
|
|
Centurion
Joined: 20 Jul 2003 Posts: 131
|
Looks like either the jar file is corrrupted or it cannot find the jar file. |
|
Back to top |
|
 |
psn |
Posted: Tue Jul 13, 2004 5:47 am Post subject: |
|
|
Disciple
Joined: 30 Oct 2002 Posts: 193 Location: France
|
but when I start with verbose it find the classes :
[Loaded java.util.StringTokenizer from /usr/j2se/jre/lib/rt.jar]
[Loaded java.io.File from /usr/j2se/jre/lib/rt.jar]
[Loaded java.io.FileSystem from /usr/j2se/jre/lib/rt.jar]
[Loaded java.io.UnixFileSystem from /usr/j2se/jre/lib/rt.jar]
[Loaded java.security.PrivilegedExceptionAction from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$2 from /usr/j2se/jre/lib/rt.jar]
[Loaded java.net.URL from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.HashSet from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.HashMap from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.HashMap$EmptyHashIterator from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.HashMap$Entry from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.misc.URLClassPath from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.ArrayList from /usr/j2se/jre/lib/rt.jar]
[Loaded java.net.URLStreamHandler from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.net.www.protocol.jar.Handler from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$AppClassLoader from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$3 from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.net.www.protocol.file.Handler from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.zip.ZipConstants from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.zip.ZipFile from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.jar.JarFile from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.security.action.LoadLibraryAction from /usr/j2se/jre/lib/rt.jar]
[Loaded java.lang.Runtime from /usr/j2se/jre/lib/rt.jar]
[Loaded java.lang.ClassLoader$4 from /usr/j2se/jre/lib/rt.jar]
[Loaded java.lang.ClassLoader$NativeLibrary from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.io.ByteToCharConverter from /usr/j2se/jre/lib/rt.jar]
[Loaded sun.io.ByteToCharISO8859_1 from /usr/j2se/jre/lib/rt.jar]
[Loaded java.io.IOException from /usr/j2se/jre/lib/rt.jar]
[Loaded java.util.zip.ZipException from /usr/j2se/jre/lib/rt.jar]
Exception in thread "main" java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:110)
at java.util.jar.JarFile.<init>(JarFile.java:115)
at java.util.jar.JarFile.<init>(JarFile.java:57)
[Loaded java.lang.Shutdown$Lock from /usr/j2se/jre/lib/rt.jar] |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 13, 2004 11:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
java -classpath /opt/mqsi/jre -jar com.tcoag.mqgetter.MQGetter IN |
Loose the -jar in your command line !
You are specifying a path in the classpath and not a list of files????....
Try:
Code: |
java -classpath /../../../xyz.jar:tfz.jar:/.../.../../klm.jar com.tcoag.mqgetter.MQGetter IN |
where xyz.jar, tfz.jar and klm.jar are the jar files containing the classes you are looking for. Note that the path to tfz.jar is relative !
Have fun
 |
|
Back to top |
|
 |
psn |
Posted: Tue Jul 13, 2004 10:38 pm Post subject: |
|
|
Disciple
Joined: 30 Oct 2002 Posts: 193 Location: France
|
thanks but now I have the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no mqjbnd05 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1312)
at java.lang.Runtime.loadLibrary0(Runtime.java:749)
....
what does it mean ?
PSN |
|
Back to top |
|
 |
MQGuy2000 |
Posted: Wed Jul 14, 2004 6:06 am Post subject: |
|
|
Centurion
Joined: 20 Jul 2003 Posts: 131
|
Its very likely mqji.properties not being in classpath. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 14, 2004 8:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you are on windows make sure
<MQROOT>\java\lib is in your path
On unix make sure <MQROOT>/java/lib is on your library path.
The name LIB_PATH for that variable changes slightly with the environment (AIX, Solaris, etc...)
Enjoy  |
|
Back to top |
|
 |
psn |
Posted: Fri Jul 16, 2004 12:29 am Post subject: |
|
|
Disciple
Joined: 30 Oct 2002 Posts: 193 Location: France
|
|
Back to top |
|
 |
MQGuy2000 |
Posted: Fri Jul 16, 2004 6:22 am Post subject: |
|
|
Centurion
Joined: 20 Jul 2003 Posts: 131
|
What worked. I mean what did you do so that it worked. |
|
Back to top |
|
 |
|