Author |
Message
|
vennela |
Posted: Wed Dec 29, 2004 11:37 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
This is nothing but a classpath problem.
Based on your earlier post This is how your classpath should look like
SET CLASSPATH=C:\Program Files\IBM\Websphere MQ\Java\lib\com.ibm.mq.jar;C:\Program Files\IBM\Websphere MQ\Java\lib\connector.jar;C:\Program Files\IBM\Websphere MQ\Java\lib\com.ibm.mqbind.jar;C:\Program Files\IBM\Websphere MQ\Java\lib\provderutil.jar;.;..;%CLASSPATH%
Then run your java program. It should work. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 29, 2004 1:32 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20763 Location: LI,NY
|
add the jndi.jar for WAS. If using pub sub add rmm.jar
If using stand alone and not was add jms.jar and jta.jar
Enjoy  |
|
Back to top |
|
 |
mqmhr |
Posted: Wed Dec 29, 2004 8:09 pm Post subject: |
|
|
Centurion
Joined: 28 Dec 2004 Posts: 105
|
Make sure that the MQSample class file is placed in a folder that is in classpath. When you execute "java MQSample", the JVM tries to locate the class file in the system classpath and if unable to locate it, throws NoClassDefFoundError.
Good Luck! |
|
Back to top |
|
 |
sebastian |
Posted: Thu Dec 30, 2004 4:52 am Post subject: |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
I updated the system CLASSPATH just as vennela indicated and rebooted. I then compiled in the C:\Program Files\IBM\Websphere MQ\Java folder. I tried to run "java MQSample" and got the same error.
very strange....
 _________________ sebastian signature |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 30, 2004 4:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
sebastian wrote: |
I updated the system CLASSPATH just as vennela indicated and rebooted. I then compiled in the C:\Program Files\IBM\Websphere MQ\Java folder. I tried to run "java MQSample" and got the same error.
very strange....
 |
It's not very strange. It just means you don't understand the solution that's been given...
Instead of updating the System Environment to set your classpath, you can specify "-classpath" as a parameter to javac, and I believe you have to use "-cp" for java. (Maybe "-classpath" works...).
So, try using these options to completely specify only the classpath you need.
BUT REMEMBER - you are working on a command line. SPACES matter. So either use the short form of windows file paths (c:\progra~1\ instead of c:\program files, for instance), or use QUOTES to protect the spaces ("c:\program files\" instead of c:\program files). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sebastian |
Posted: Fri Dec 31, 2004 9:43 am Post subject: |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
I got it...thanks for everyone's input!!
happy new year,
Sebastian  _________________ sebastian signature |
|
Back to top |
|
 |
|