Author |
Message
|
nyey |
Posted: Tue Apr 08, 2003 8:43 am Post subject: Class Not Found for java.lang.NoClassDefFoundError: com/ibm/ |
|
|
Acolyte
Joined: 13 Mar 2003 Posts: 57
|
Hi. I have this error: java.lang.NoClassDefFoundError: com/ibm/mq/ReasonCodeInfo
while I checked that I have the class in the same jar with MQQueueManager.
Any idea?
Thanks.
More Error Log:
MQJE001: Completion Code 2, Reason 2033
java.lang.NoClassDefFoundError: com/ibm/mq/ReasonCodeInfo
at com.ibm.mq.MQQueueManager.errorOccurred(MQQueueManager.java:1746)
at com.ibm.mq.MQQueue.get(MQQueue.java:824)
at com.tradewinds.liveupdate.FDNMQConnection.mqGet(FDNMQConnection.java:369)
at com.tradewinds.liveupdate.MsgPicker.doWork(MsgPicker.java:130)
at com.tradewinds.liveupdate.FDNRunnable.run(FDNRunnable.java:2
at java.lang.Thread.run(Thread.java:512)
MQJE001: Completion Code 2, Reason 2033
java.lang.NoClassDefFoundError: com/ibm/mq/ReasonCodeInfo
at com.ibm.mq.MQQueueManager.errorOccurred(MQQueueManager.java:1746)
at com.ibm.mq.MQQueue.get(MQQueue.java:824)
at com.tradewinds.liveupdate.FDNMQConnection.mqGet(FDNMQConnection.java:369)
at com.tradewinds.liveupdate.MsgPicker.doWork(MsgPicker.java:130)
at com.tradewinds.liveupdate.FDNRunnable.run(FDNRunnable.java:2
at java.lang.Thread.run(Thread.java:512) |
|
Back to top |
|
 |
vennela |
Posted: Tue Apr 08, 2003 9:26 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
What version of MQ (or MA88) are you running?
-------
Venny |
|
Back to top |
|
 |
nyey |
Posted: Tue Apr 08, 2003 10:11 am Post subject: |
|
|
Acolyte
Joined: 13 Mar 2003 Posts: 57
|
MQ 5.3.0.1 on win 2K Server |
|
Back to top |
|
 |
vennela |
Posted: Tue Apr 08, 2003 12:50 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
You double check your CLASSPATH.
Because MQQueueManager class is also in com.ibm.mqbind.jar.
Make sure you have com.ibm.mq.jar is in your CLASSPATH.
-------
Venny |
|
Back to top |
|
 |
avish |
Posted: Thu Apr 17, 2003 9:59 am Post subject: |
|
|
 Newbie
Joined: 08 Apr 2003 Posts: 2
|
I had COM.IBM.MQ.JAR and other required jar files defined in my CLASSPATH, but I was getting almost the same error.
Make sure all these required jar files are added to the lib in your development environment.
I am using WSAD and I imported required MQ jar files to my project and
solved the problem. |
|
Back to top |
|
 |
sevenfan |
Posted: Fri May 23, 2003 7:30 am Post subject: Same Kind of Error |
|
|
Apprentice
Joined: 22 May 2003 Posts: 42
|
I have included the jar file com.ibm.mq.jar in my classpath, and also when I use my IDE (NetBeans). The compile is OK, but execution of any kind gives me this error: Exception in thread "main" java.lang.NoClassDefFoundError: mqput
The source file name is mqput.java and the resulting class file is mqput.class. I execute with the following command line:
java -cp "com.ibm.mq.jar" mqput.
The source was posted as a reply to me on an earlier question.
import com.ibm.mq.*;
public class mqput extends Object {
public mqput(){
}
public static void main(String args[]){
String QMGR = args[1];
String QUEUE = args[0];
System.out.println("MQPut Program started");
try{
MQQueueManager qmgr = new MQQueueManager(QMGR);
System.out.println("Connected to QMGR :" + QMGR);
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING ;
MQQueue InQueue = qmgr.accessQueue(QUEUE , openOptions, null, null, nul
l);MQMD messageDesc = new MQMD();
MQMessage inMessage = new MQMessage();
inMessage.writeString("What is your name");
InQueue.put(inMessage);
System.out.println("Message Id is :" + inMessage.messageId);
InQueue.close();
qmgr.disconnect();
}
catch (MQException ex){
System.out.println("MQ Error - Reason code :" + ex.reasonCode);
}
catch(Exception e){
System.out.println("Error : " + e);
}
}
}
Any help is appreciated. |
|
Back to top |
|
 |
bower5932 |
Posted: Fri May 23, 2003 7:49 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I've always used a classpath environment variable to specify my classpath rather than the "-cp". Is it possible that you need to specify the entire classpath with -cp instead of just the jar? Have you tried this? |
|
Back to top |
|
 |
sevenfan |
Posted: Fri May 23, 2003 8:34 am Post subject: Classpath |
|
|
Apprentice
Joined: 22 May 2003 Posts: 42
|
I have tried both ways, with -cp and with -classpath |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri May 23, 2003 9:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What bower5932 is suggesting is that you need to use the -cp option on the command line to ADD the mq jar file TO your existing classpath environment variable.
On Windows, it would be done like this:
java -cp "com.ibm.mq.jar";"%classpath%" mqput
But what the error message is telling you is that it can't find your mqput.class file. This is most likely because the directory where your mqput.class file is kept is not on your classpath. |
|
Back to top |
|
 |
|