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 » Class Not Found for java.lang.NoClassDefFoundError: com/ibm/

Post new topic  Reply to topic
 Class Not Found for java.lang.NoClassDefFoundError: com/ibm/ « View previous topic :: View next topic » 
Author Message
nyey
PostPosted: Tue Apr 08, 2003 8:43 am    Post subject: Class Not Found for java.lang.NoClassDefFoundError: com/ibm/ Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Tue Apr 08, 2003 9:26 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

What version of MQ (or MA88) are you running?

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nyey
PostPosted: Tue Apr 08, 2003 10:11 am    Post subject: Reply with quote

Acolyte

Joined: 13 Mar 2003
Posts: 57

MQ 5.3.0.1 on win 2K Server
Back to top
View user's profile Send private message
vennela
PostPosted: Tue Apr 08, 2003 12:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
avish
PostPosted: Thu Apr 17, 2003 9:59 am    Post subject: Reply with quote

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
View user's profile Send private message
sevenfan
PostPosted: Fri May 23, 2003 7:30 am    Post subject: Same Kind of Error Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Fri May 23, 2003 7:49 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
sevenfan
PostPosted: Fri May 23, 2003 8:34 am    Post subject: Classpath Reply with quote

Apprentice

Joined: 22 May 2003
Posts: 42

I have tried both ways, with -cp and with -classpath
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri May 23, 2003 9:10 am    Post subject: Reply with quote

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
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 » Class Not Found for java.lang.NoClassDefFoundError: com/ibm/
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.