ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » java exception

Post new topic  Reply to topic
 java exception « View previous topic :: View next topic » 
Author Message
psn
PostPosted: Tue Jul 13, 2004 5:33 am    Post subject: java exception Reply with quote

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
View user's profile Send private message
MQGuy2000
PostPosted: Tue Jul 13, 2004 5:44 am    Post subject: Reply with quote

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
View user's profile Send private message
psn
PostPosted: Tue Jul 13, 2004 5:47 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 13, 2004 11:31 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
psn
PostPosted: Tue Jul 13, 2004 10:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
MQGuy2000
PostPosted: Wed Jul 14, 2004 6:06 am    Post subject: Reply with quote

Centurion

Joined: 20 Jul 2003
Posts: 131

Its very likely mqji.properties not being in classpath.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 14, 2004 8:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
psn
PostPosted: Fri Jul 16, 2004 12:29 am    Post subject: Reply with quote

Disciple

Joined: 30 Oct 2002
Posts: 193
Location: France

it works ! Thank you !
Back to top
View user's profile Send private message
MQGuy2000
PostPosted: Fri Jul 16, 2004 6:22 am    Post subject: Reply with quote

Centurion

Joined: 20 Jul 2003
Posts: 131

What worked. I mean what did you do so that it worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » java exception
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.